Skip to content

Commit

Permalink
ddl: make several test cases stable for make ut (#31878)
Browse files Browse the repository at this point in the history
close #31085
  • Loading branch information
tiancaiamao authored Jan 24, 2022
1 parent 2fe6e81 commit 98068fe
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 @@ -3553,6 +3553,13 @@ func TestRenameTables(t *testing.T) {
ddl.ExportTestRenameTables(t)
}

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

ddl.ExportTestRenameTables(t)
}

func (s *testIntegrationSuite1) TestDuplicatePartitionNames(c *C) {
tk := testkit.NewTestKit(c, s.store)

Expand Down
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 @@ -402,7 +402,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)
defer func() {
Expand Down

0 comments on commit 98068fe

Please sign in to comment.