Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

executor: split test for speed up #12881

Merged
merged 4 commits into from
Oct 23, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion executor/adapter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
"github.com/pingcap/tidb/util/testkit"
)

func (s *testSuiteP1) TestQueryTime(c *C) {
func (s *testSuiteP2) TestQueryTime(c *C) {
tk := testkit.NewTestKit(c, s.store)
tk.MustExec("use test")

Expand Down
14 changes: 7 additions & 7 deletions executor/admin_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ func (s *testSuite1) TestAdminCheckIndexRange(c *C) {
result.Check(testkit.Rows("-1 hi 4", "2 cd 2"))
}

func (s *testSuite2) TestAdminRecoverIndex(c *C) {
func (s *testSuite5) TestAdminRecoverIndex(c *C) {
tk := testkit.NewTestKit(c, s.store)
tk.MustExec("use test")
tk.MustExec("drop table if exists admin_test")
Expand Down Expand Up @@ -158,7 +158,7 @@ func (s *testSuite2) TestAdminRecoverIndex(c *C) {
tk.MustExec("admin check table admin_test")
}

func (s *testSuite2) TestAdminRecoverIndex1(c *C) {
func (s *testSuite5) TestAdminRecoverIndex1(c *C) {
tk := testkit.NewTestKit(c, s.store)
s.ctx = mock.NewContext()
s.ctx.Store = s.store
Expand Down Expand Up @@ -209,7 +209,7 @@ func (s *testSuite2) TestAdminRecoverIndex1(c *C) {
tk.MustExec("admin check index admin_test `primary`")
}

func (s *testSuite2) TestAdminCleanupIndex(c *C) {
func (s *testSuite5) TestAdminCleanupIndex(c *C) {
tk := testkit.NewTestKit(c, s.store)
tk.MustExec("use test")
tk.MustExec("drop table if exists admin_test")
Expand Down Expand Up @@ -288,7 +288,7 @@ func (s *testSuite2) TestAdminCleanupIndex(c *C) {
tk.MustExec("admin check table admin_test")
}

func (s *testSuite2) TestAdminCleanupIndexPKNotHandle(c *C) {
func (s *testSuite5) TestAdminCleanupIndexPKNotHandle(c *C) {
tk := testkit.NewTestKit(c, s.store)
tk.MustExec("use test")
tk.MustExec("drop table if exists admin_test")
Expand Down Expand Up @@ -336,7 +336,7 @@ func (s *testSuite2) TestAdminCleanupIndexPKNotHandle(c *C) {
tk.MustExec("admin check table admin_test")
}

func (s *testSuite2) TestAdminCleanupIndexMore(c *C) {
func (s *testSuite5) TestAdminCleanupIndexMore(c *C) {
tk := testkit.NewTestKit(c, s.store)
tk.MustExec("use test")
tk.MustExec("drop table if exists admin_test")
Expand Down Expand Up @@ -399,7 +399,7 @@ func (s *testSuite2) TestAdminCleanupIndexMore(c *C) {
tk.MustExec("admin check table admin_test")
}

func (s *testSuite2) TestAdminCheckTableFailed(c *C) {
func (s *testSuite5) TestAdminCheckTableFailed(c *C) {
tk := testkit.NewTestKit(c, s.store)
tk.MustExec("use test")
tk.MustExec("drop table if exists admin_test")
Expand Down Expand Up @@ -631,7 +631,7 @@ func (s *testSuite1) TestAdminCheckPrimaryIndex(c *C) {
tk.MustExec("admin check index t idx;")
}

func (s *testSuite2) TestAdminCheckWithSnapshot(c *C) {
func (s *testSuite5) TestAdminCheckWithSnapshot(c *C) {
tk := testkit.NewTestKit(c, s.store)
tk.MustExec("use test")
tk.MustExec("drop table if exists admin_t_s")
Expand Down
50 changes: 25 additions & 25 deletions executor/ddl_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ import (
"github.com/pingcap/tidb/util/testutil"
)

func (s *testSuite3) TestTruncateTable(c *C) {
func (s *testSuite6) TestTruncateTable(c *C) {
tk := testkit.NewTestKit(c, s.store)
tk.MustExec("use test")
tk.MustExec(`drop table if exists truncate_test;`)
Expand All @@ -59,7 +59,7 @@ func (s *testSuite3) TestTruncateTable(c *C) {
// 1. Execute the SQL of "begin";
// 2. A SQL that will fail to execute;
// 3. Execute DDL.
func (s *testSuite3) TestInTxnExecDDLFail(c *C) {
func (s *testSuite6) TestInTxnExecDDLFail(c *C) {
tk := testkit.NewTestKit(c, s.store)
tk.MustExec("use test")
tk.MustExec("create table t (i int key);")
Expand All @@ -72,7 +72,7 @@ func (s *testSuite3) TestInTxnExecDDLFail(c *C) {
result.Check(testkit.Rows("1"))
}

func (s *testSuite3) TestCreateTable(c *C) {
func (s *testSuite6) TestCreateTable(c *C) {
tk := testkit.NewTestKit(c, s.store)
tk.MustExec("use test")
// Test create an exist database
Expand Down Expand Up @@ -173,7 +173,7 @@ func (s *testSuite3) TestCreateTable(c *C) {
r.Check(testkit.Rows("1000 aa"))
}

func (s *testSuite3) TestCreateView(c *C) {
func (s *testSuite6) TestCreateView(c *C) {
tk := testkit.NewTestKit(c, s.store)
tk.MustExec("use test")
//create an source table
Expand Down Expand Up @@ -226,7 +226,7 @@ func (s *testSuite3) TestCreateView(c *C) {
tk.MustExec("execute stmt")
}

func (s *testSuite3) TestCreateDropDatabase(c *C) {
func (s *testSuite6) TestCreateDropDatabase(c *C) {
tk := testkit.NewTestKit(c, s.store)
tk.MustExec("create database if not exists drop_test;")
tk.MustExec("drop database if exists drop_test;")
Expand All @@ -242,7 +242,7 @@ func (s *testSuite3) TestCreateDropDatabase(c *C) {
c.Assert(err, NotNil)
}

func (s *testSuite3) TestCreateDropTable(c *C) {
func (s *testSuite6) TestCreateDropTable(c *C) {
tk := testkit.NewTestKit(c, s.store)
tk.MustExec("use test")
tk.MustExec("create table if not exists drop_test (a int)")
Expand All @@ -254,7 +254,7 @@ func (s *testSuite3) TestCreateDropTable(c *C) {
c.Assert(err, NotNil)
}

func (s *testSuite3) TestCreateDropView(c *C) {
func (s *testSuite6) TestCreateDropView(c *C) {
tk := testkit.NewTestKit(c, s.store)
tk.MustExec("use test")
tk.MustExec("create or replace view drop_test as select 1,2")
Expand All @@ -272,7 +272,7 @@ func (s *testSuite3) TestCreateDropView(c *C) {
c.Assert(err.Error(), Equals, "[ddl:1347]'test.t_v' is not VIEW")
}

func (s *testSuite3) TestCreateDropIndex(c *C) {
func (s *testSuite6) TestCreateDropIndex(c *C) {
tk := testkit.NewTestKit(c, s.store)
tk.MustExec("use test")
tk.MustExec("create table if not exists drop_test (a int)")
Expand All @@ -281,7 +281,7 @@ func (s *testSuite3) TestCreateDropIndex(c *C) {
tk.MustExec("drop table drop_test")
}

func (s *testSuite3) TestAlterTableAddColumn(c *C) {
func (s *testSuite6) TestAlterTableAddColumn(c *C) {
tk := testkit.NewTestKit(c, s.store)
tk.MustExec("use test")
tk.MustExec("create table if not exists alter_test (c1 int)")
Expand All @@ -306,7 +306,7 @@ func (s *testSuite3) TestAlterTableAddColumn(c *C) {
tk.MustExec("drop view alter_view")
}

func (s *testSuite3) TestAddNotNullColumnNoDefault(c *C) {
func (s *testSuite6) TestAddNotNullColumnNoDefault(c *C) {
tk := testkit.NewTestKit(c, s.store)
tk.MustExec("use test")
tk.MustExec("create table nn (c1 int)")
Expand All @@ -327,7 +327,7 @@ func (s *testSuite3) TestAddNotNullColumnNoDefault(c *C) {
tk.MustQuery("select * from nn").Check(testkit.Rows("1 0", "2 0", "3 0"))
}

func (s *testSuite3) TestAlterTableModifyColumn(c *C) {
func (s *testSuite6) TestAlterTableModifyColumn(c *C) {
tk := testkit.NewTestKit(c, s.store)
tk.MustExec("use test")
tk.MustExec("drop table if exists mc")
Expand Down Expand Up @@ -392,7 +392,7 @@ func (s *testSuite3) TestAlterTableModifyColumn(c *C) {

}

func (s *testSuite3) TestDefaultDBAfterDropCurDB(c *C) {
func (s *testSuite6) TestDefaultDBAfterDropCurDB(c *C) {
tk := testkit.NewTestKit(c, s.store)

testSQL := `create database if not exists test_db CHARACTER SET latin1 COLLATE latin1_swedish_ci;`
Expand All @@ -411,7 +411,7 @@ func (s *testSuite3) TestDefaultDBAfterDropCurDB(c *C) {
tk.MustQuery(`select @@collation_database;`).Check(testkit.Rows("utf8_unicode_ci"))
}

func (s *testSuite3) TestRenameTable(c *C) {
func (s *testSuite6) TestRenameTable(c *C) {
c.Assert(failpoint.Enable("github.com/pingcap/tidb/meta/autoid/mockAutoIDChange", `return(true)`), IsNil)
defer func() {
c.Assert(failpoint.Disable("github.com/pingcap/tidb/meta/autoid/mockAutoIDChange"), IsNil)
Expand Down Expand Up @@ -471,7 +471,7 @@ func (s *testSuite3) TestRenameTable(c *C) {
tk.MustExec("drop database rename2")
}

func (s *testSuite3) TestColumnCharsetAndCollate(c *C) {
func (s *testSuite6) TestColumnCharsetAndCollate(c *C) {
tk := testkit.NewTestKit(c, s.store)
dbName := "col_charset_collate"
tk.MustExec("create database " + dbName)
Expand Down Expand Up @@ -555,7 +555,7 @@ func (s *testSuite3) TestColumnCharsetAndCollate(c *C) {
tk.MustExec("drop database " + dbName)
}

func (s *testSuite3) TestTooLargeIdentifierLength(c *C) {
func (s *testSuite6) TestTooLargeIdentifierLength(c *C) {
tk := testkit.NewTestKit(c, s.store)

// for database.
Expand Down Expand Up @@ -590,7 +590,7 @@ func (s *testSuite3) TestTooLargeIdentifierLength(c *C) {
c.Assert(err.Error(), Equals, fmt.Sprintf("[ddl:1059]Identifier name '%s' is too long", indexName2))
}

func (s *testSuite3) TestShardRowIDBits(c *C) {
func (s *testSuite6) TestShardRowIDBits(c *C) {
tk := testkit.NewTestKit(c, s.store)

tk.MustExec("use test")
Expand Down Expand Up @@ -703,7 +703,7 @@ func (s *testSuite3) TestShardRowIDBits(c *C) {
c.Assert(autoid.ErrAutoincReadFailed.Equal(err), IsTrue, Commentf("err:%v", err))
}

func (s *testSuite3) TestMaxHandleAddIndex(c *C) {
func (s *testSuite6) TestMaxHandleAddIndex(c *C) {
tk := testkit.NewTestKit(c, s.store)

tk.MustExec("use test")
Expand All @@ -720,7 +720,7 @@ func (s *testSuite3) TestMaxHandleAddIndex(c *C) {
tk.MustExec("admin check table t1")
}

func (s *testSuite3) TestSetDDLReorgWorkerCnt(c *C) {
func (s *testSuite6) TestSetDDLReorgWorkerCnt(c *C) {
tk := testkit.NewTestKit(c, s.store)
tk.MustExec("use test")
err := ddlutil.LoadDDLReorgVars(tk.Se)
Expand Down Expand Up @@ -754,7 +754,7 @@ func (s *testSuite3) TestSetDDLReorgWorkerCnt(c *C) {
res.Check(testkit.Rows("100"))
}

func (s *testSuite3) TestSetDDLReorgBatchSize(c *C) {
func (s *testSuite6) TestSetDDLReorgBatchSize(c *C) {
tk := testkit.NewTestKit(c, s.store)
tk.MustExec("use test")
err := ddlutil.LoadDDLReorgVars(tk.Se)
Expand Down Expand Up @@ -791,7 +791,7 @@ func (s *testSuite3) TestSetDDLReorgBatchSize(c *C) {
res.Check(testkit.Rows("1000"))
}

func (s *testSuite3) TestIllegalFunctionCall4GeneratedColumns(c *C) {
func (s *testSuite6) TestIllegalFunctionCall4GeneratedColumns(c *C) {
tk := testkit.NewTestKit(c, s.store)
tk.MustExec("use test")
// Test create an exist database
Expand Down Expand Up @@ -836,7 +836,7 @@ func (s *testSuite3) TestIllegalFunctionCall4GeneratedColumns(c *C) {
c.Assert(err.Error(), Equals, ddl.ErrGeneratedColumnFunctionIsNotAllowed.GenWithStackByArgs("cc").Error())
}

func (s *testSuite3) TestGeneratedColumnRelatedDDL(c *C) {
func (s *testSuite6) TestGeneratedColumnRelatedDDL(c *C) {
tk := testkit.NewTestKit(c, s.store)
tk.MustExec("use test")
// Test create an exist database
Expand All @@ -862,7 +862,7 @@ func (s *testSuite3) TestGeneratedColumnRelatedDDL(c *C) {
tk.MustExec("drop table t1;")
}

func (s *testSuite3) TestSetDDLErrorCountLimit(c *C) {
func (s *testSuite6) TestSetDDLErrorCountLimit(c *C) {
tk := testkit.NewTestKit(c, s.store)
tk.MustExec("use test")
err := ddlutil.LoadDDLVars(tk.Se)
Expand Down Expand Up @@ -891,7 +891,7 @@ func (s *testSuite3) TestSetDDLErrorCountLimit(c *C) {

// Test issue #9205, fix the precision problem for time type default values
// See https://github.com/pingcap/tidb/issues/9205 for details
func (s *testSuite3) TestIssue9205(c *C) {
func (s *testSuite6) TestIssue9205(c *C) {
tk := testkit.NewTestKit(c, s.store)
tk.MustExec("use test")
tk.MustExec(`drop table if exists t;`)
Expand Down Expand Up @@ -930,7 +930,7 @@ func (s *testSuite3) TestIssue9205(c *C) {
))
}

func (s *testSuite3) TestCheckDefaultFsp(c *C) {
func (s *testSuite6) TestCheckDefaultFsp(c *C) {
tk := testkit.NewTestKit(c, s.store)
tk.MustExec("use test")
tk.MustExec(`drop table if exists t;`)
Expand Down Expand Up @@ -970,7 +970,7 @@ func (s *testSuite3) TestCheckDefaultFsp(c *C) {
c.Assert(err.Error(), Equals, "[ddl:1067]Invalid default value for 'tttt'")
}

func (s *testSuite3) TestTimestampMinDefaultValue(c *C) {
func (s *testSuite6) TestTimestampMinDefaultValue(c *C) {
tk := testkit.NewTestKit(c, s.store)
tk.MustExec("use test")
tk.MustExec("drop table if exists tdv;")
Expand Down
Loading