diff --git a/.github/workflows/vitess_tester_vtgate.yml b/.github/workflows/vitess_tester_vtgate.yml index f9429909374..7cb349312b7 100644 --- a/.github/workflows/vitess_tester_vtgate.yml +++ b/.github/workflows/vitess_tester_vtgate.yml @@ -148,8 +148,10 @@ jobs: # If there is a vschema file there, we use it, otherwise we let vt tester autogenerate it. if [ -f $dir/vschema.json ]; then vt tester --xunit --vschema "$dir"vschema.json $dir/*.test - else + vt tester --olap --xunit --vschema "$dir"vschema.json $dir/*.test + else vt tester --sharded --xunit $dir/*.test + vt tester --olap --sharded --xunit $dir/*.test fi # Number the reports by changing their file names. mv report.xml report"$i".xml diff --git a/go/test/endtoend/vtgate/plan_tests/main_test.go b/go/test/endtoend/vtgate/plan_tests/main_test.go index 2dc2e70120b..9281d282017 100644 --- a/go/test/endtoend/vtgate/plan_tests/main_test.go +++ b/go/test/endtoend/vtgate/plan_tests/main_test.go @@ -179,7 +179,8 @@ func verifyTestExpectations(t *testing.T, pd engine.PrimitiveDescription, test p // 1. Verify that the Join primitive sees atleast 1 row on the left side. engine.WalkPrimitiveDescription(pd, func(description engine.PrimitiveDescription) { if description.OperatorType == "Join" { - assert.NotZero(t, description.Inputs[0].RowsReceived[0]) + message := fmt.Sprintf("expected at least 1 row on the left side of the join for query: %s", test.Query) + assert.NotZero(t, description.Inputs[0].RowsReceived[0], message) } }) diff --git a/go/test/endtoend/vtgate/plan_tests/plan_e2e_test.go b/go/test/endtoend/vtgate/plan_tests/plan_e2e_test.go index 0068616c3b8..a87c5757363 100644 --- a/go/test/endtoend/vtgate/plan_tests/plan_e2e_test.go +++ b/go/test/endtoend/vtgate/plan_tests/plan_e2e_test.go @@ -38,24 +38,34 @@ func TestE2ECases(t *testing.T) { mcmp, closer := start(t) defer closer() loadSampleData(t, mcmp) - for _, fileName := range e2eTestCaseFiles { - tests := readJSONTests(fileName) - for _, test := range tests { - mcmp.Run(test.Comment, func(mcmp *utils.MySQLCompare) { - if test.SkipE2E { - mcmp.AsT().Skip(test.Query) - } - stmt, err := sqlparser.NewTestParser().Parse(test.Query) - require.NoError(mcmp.AsT(), err) - sqlparser.RemoveKeyspaceIgnoreSysSchema(stmt) - - mcmp.ExecVitessAndMySQLDifferentQueries(test.Query, sqlparser.String(stmt)) - pd := utils.ExecTrace(mcmp.AsT(), mcmp.VtConn, test.Query) - verifyTestExpectations(mcmp.AsT(), pd, test) - if mcmp.VtConn.IsClosed() { - mcmp.AsT().Fatal("vtgate connection is closed") + parser := sqlparser.NewTestParser() + + for _, mode := range []string{"oltp", "olap"} { + mcmp.Run(mode, func(mcmp *utils.MySQLCompare) { + utils.Exec(t, mcmp.VtConn, "set workload = "+mode) + for _, fileName := range e2eTestCaseFiles { + tests := readJSONTests(fileName) + for _, test := range tests { + mcmp.Run(test.Comment, func(mcmp *utils.MySQLCompare) { + if test.SkipE2E { + mcmp.AsT().Skip(test.Query) + } + stmt, err := parser.Parse(test.Query) + require.NoError(mcmp.AsT(), err) + sqlparser.RemoveKeyspaceIgnoreSysSchema(stmt) + + mcmp.ExecVitessAndMySQLDifferentQueries(test.Query, sqlparser.String(stmt)) + pd := utils.ExecTrace(mcmp.AsT(), mcmp.VtConn, test.Query) + if mode == "oltp" { + // we only need to test the plan for OLTP. + verifyTestExpectations(mcmp.AsT(), pd, test) + } + if mcmp.VtConn.IsClosed() { + mcmp.AsT().Fatal("vtgate connection is closed") + } + }) } - }) - } + } + }) } } diff --git a/test/templates/cluster_vitess_tester.tpl b/test/templates/cluster_vitess_tester.tpl index 6b26e5925a4..57b234af5ba 100644 --- a/test/templates/cluster_vitess_tester.tpl +++ b/test/templates/cluster_vitess_tester.tpl @@ -153,8 +153,10 @@ jobs: # If there is a vschema file there, we use it, otherwise we let vt tester autogenerate it. if [ -f $dir/vschema.json ]; then vt tester --xunit --vschema "$dir"vschema.json $dir/*.test - else + vt tester --olap --xunit --vschema "$dir"vschema.json $dir/*.test + else vt tester --sharded --xunit $dir/*.test + vt tester --olap --sharded --xunit $dir/*.test fi # Number the reports by changing their file names. mv report.xml report"$i".xml