Skip to content
Closed
Show file tree
Hide file tree
Changes from 2 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
4 changes: 3 additions & 1 deletion .github/workflows/vitess_tester_vtgate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
42 changes: 24 additions & 18 deletions go/test/endtoend/vtgate/plan_tests/plan_e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,24 +38,30 @@ 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")

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 := 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")
}
})
}
})
}
}
})
}
}
4 changes: 3 additions & 1 deletion test/templates/cluster_vitess_tester.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down