Skip to content

Commit

Permalink
executor, tests: move IT in executor/test/issuetest to `tests/integ…
Browse files Browse the repository at this point in the history
…rationtest` (#47077)

ref #47076
  • Loading branch information
Defined2014 authored Sep 25, 2023
1 parent df76319 commit ae42b5a
Show file tree
Hide file tree
Showing 7 changed files with 1,332 additions and 821 deletions.
3 changes: 1 addition & 2 deletions executor/test/issuetest/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ go_test(
"main_test.go",
],
flaky = True,
shard_count = 50,
shard_count = 17,
deps = [
"//autoid_service",
"//config",
Expand All @@ -18,7 +18,6 @@ go_test(
"//parser/charset",
"//parser/mysql",
"//session",
"//sessionctx/variable",
"//testkit",
"//util",
"//util/memory",
Expand Down
804 changes: 17 additions & 787 deletions executor/test/issuetest/executor_issue_test.go

Large diffs are not rendered by default.

22 changes: 7 additions & 15 deletions executor/window_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,30 +32,20 @@ func TestWindowFunctions(t *testing.T) {
tk.MustExec("set @@tidb_enable_pipelined_window_function=1;")
}()
doTestWindowFunctions(tk)
}

func TestWindowParallelFunctions(t *testing.T) {
store := testkit.CreateMockStore(t)
tk := testkit.NewTestKit(t, store)
// TestWindowParallelFunctions
tk.MustExec("set @@tidb_window_concurrency = 4")
tk.MustExec("set @@tidb_enable_pipelined_window_function = 0")
defer func() {
tk.MustExec("set @@tidb_enable_pipelined_window_function=1;")
}()
doTestWindowFunctions(tk)
}

func TestPipelinedWindowFunctions(t *testing.T) {
store := testkit.CreateMockStore(t)
tk := testkit.NewTestKit(t, store)
// TestPipelinedWindowFunctions
tk.MustExec("set @@tidb_window_concurrency = 1")
tk.MustExec("set @@tidb_enable_pipelined_window_function = 1")
doTestWindowFunctions(tk)
}

func TestPipelinedWindowParallelFunctions(t *testing.T) {
store := testkit.CreateMockStore(t)
tk := testkit.NewTestKit(t, store)
// TestPipelinedWindowParallelFunctions
tk.MustExec("set @@tidb_window_concurrency = 4")
tk.MustExec("set @@tidb_enable_pipelined_window_function = 1")
doTestWindowFunctions(tk)
}

Expand Down Expand Up @@ -194,6 +184,7 @@ func doTestWindowFunctions(tk *testkit.TestKit) {

tk.MustQuery("select lead(a) over(partition by null) from t").Sort().Check(testkit.Rows("1", "2", "2", "<nil>"))

tk.MustExec("drop table if exists issue10494")
tk.MustExec("create table issue10494(a INT, b CHAR(1), c DATETIME, d BLOB)")
tk.MustExec("insert into issue10494 VALUES (1,'x','2010-01-01','blob'), (2, 'y', '2011-01-01', ''), (3, 'y', '2012-01-01', ''), (4, 't', '2012-01-01', 'blob'), (5, null, '2013-01-01', null)")
tk.MustQuery("SELECT a, b, c, SUM(a) OVER (RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) FROM issue10494 order by a;").Check(
Expand All @@ -206,6 +197,7 @@ func doTestWindowFunctions(tk *testkit.TestKit) {
),
)

tk.MustExec("drop table if exists td_dec")
tk.MustExec("CREATE TABLE td_dec (id DECIMAL(10,2), sex CHAR(1));")
tk.MustExec("insert into td_dec value (2.0, 'F'), (NULL, 'F'), (1.0, 'F')")
tk.MustQuery("SELECT id, FIRST_VALUE(id) OVER w FROM td_dec WINDOW w AS (ORDER BY id);").Check(
Expand Down
1 change: 0 additions & 1 deletion store/mockstore/mockcopr/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ go_test(
],
embed = [":mockcopr"],
flaky = True,
shard_count = 3,
deps = [
"//domain",
"//kv",
Expand Down
16 changes: 0 additions & 16 deletions store/mockstore/mockcopr/executor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,22 +109,6 @@ func TestResolvedLargeTxnLocks(t *testing.T) {
require.True(t, ok)
}

func TestIssue15662(t *testing.T) {
store := testkit.CreateMockStore(t)
tk := testkit.NewTestKit(t, store)

tk.MustExec("use test")

tk.MustExec("create table V (id int primary key, col_int int)")
tk.MustExec("insert into V values (1, 8)")

tk.MustExec("create table F (id int primary key, col_int int)")
tk.MustExec("insert into F values (1, 8)")

tk.MustQuery("select table1.`col_int` as field1, table1.`col_int` as field2 from V as table1 left join F as table2 on table1.`col_int` = table2.`col_int` order by field1, field2 desc limit 2").
Check(testkit.Rows("8 8"))
}

func putMutations(kvpairs ...string) []*kvrpcpb.Mutation {
var mutations []*kvrpcpb.Mutation
for i := 0; i < len(kvpairs); i += 2 {
Expand Down
Loading

0 comments on commit ae42b5a

Please sign in to comment.