Skip to content

Commit

Permalink
ddl: make several test cases stable for make ut
Browse files Browse the repository at this point in the history
  • Loading branch information
tiancaiamao committed Jan 21, 2022
1 parent 2d62d23 commit 7a24e76
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 3 deletions.
7 changes: 7 additions & 0 deletions ddl/db_partition_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3552,3 +3552,10 @@ func TestRenameTables(t *testing.T) {

ddl.ExportTestRenameTables(t)
}

func TestCreateTables(t *testing.T) {
_, clean := ntestkit.CreateMockStore(t)
defer clean()

ddl.ExportTestRenameTables(t)
}
14 changes: 14 additions & 0 deletions ddl/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,3 +119,17 @@ func TestDDLStatementsBackFill(t *testing.T) {
require.Equal(t, tc.expectedNeedReorg, needReorg, tc)
}
}

func TestSchema(t *testing.T) {
_, clean := testkit.CreateMockStore(t)
defer clean()

ddl.ExportTestSchema(t)
}

func TestTestSerialStatSuite(t *testing.T) {
_, clean := testkit.CreateMockStore(t)
defer clean()

ddl.ExportTestSerialStatSuite(t)
}
2 changes: 1 addition & 1 deletion ddl/schema_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ func testCheckSchemaState(test *testing.T, d *ddl, dbInfo *model.DBInfo, state m
}
}

func TestSchema(t *testing.T) {
func ExportTestSchema(t *testing.T) {
store := testCreateStore(t, "test_schema")
defer func() {
err := store.Close()
Expand Down
2 changes: 1 addition & 1 deletion ddl/stat_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ type testSerialStatSuiteToVerify struct {
suite.Suite
}

func TestSerialStatSuite(t *testing.T) {
func ExportTestSerialStatSuite(t *testing.T) {
suite.Run(t, new(testSerialStatSuiteToVerify))
}

Expand Down
2 changes: 1 addition & 1 deletion ddl/table_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ func ExportTestRenameTables(t *testing.T) {
require.Equal(t, wantTblInfos[1].Name.L, "tt2")
}

func TestCreateTables(t *testing.T) {
func ExportTestCreateTables(t *testing.T) {
store, err := mockstore.NewMockStore()
require.NoError(t, err)
ddl, err := testNewDDLAndStart(
Expand Down

0 comments on commit 7a24e76

Please sign in to comment.