Skip to content

Commit

Permalink
test: make e2e plan-tests run DML cases
Browse files Browse the repository at this point in the history
Signed-off-by: Andres Taylor <[email protected]>
  • Loading branch information
systay committed Dec 20, 2024
1 parent 4798918 commit 4565dca
Show file tree
Hide file tree
Showing 4 changed files with 489 additions and 247 deletions.
2 changes: 1 addition & 1 deletion go/test/endtoend/vtgate/plan_tests/plan_e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (
)

func TestE2ECases(t *testing.T) {
e2eTestCaseFiles := []string{"select_cases.json", "filter_cases.json"}
e2eTestCaseFiles := []string{"select_cases.json", "filter_cases.json", "dml_cases.json"}
mcmp, closer := start(t)
defer closer()
loadSampleData(t, mcmp)
Expand Down
6 changes: 5 additions & 1 deletion go/vt/vtgate/engine/plan_description.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,11 @@ func PrimitiveDescriptionFromMap(data map[string]any) (pd PrimitiveDescription,
}
}
if ttt, isPresent := data["TargetTabletType"]; isPresent {
pd.TargetTabletType = topodatapb.TabletType(ttt.(int))
val, ok := topodatapb.TabletType_value[ttt.(string)]
if !ok {
panic(fmt.Sprintf("TargetTabletType is not a valid tablet type: %v", ttt))
}
pd.TargetTabletType = topodatapb.TabletType(val)
}
if other, isPresent := data["Other"]; isPresent {
pd.Other = other.(map[string]any)
Expand Down
2 changes: 1 addition & 1 deletion go/vt/vtgate/planbuilder/plan_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -666,7 +666,7 @@ func (s *planTestSuite) testFile(filename string, vschema *vschemawrapper.VSchem
current := PlanTest{
Comment: tcase.Comment,
Query: tcase.Query,
SkipE2E: tcase.SkipE2E,
SkipE2E: true,
}
vschema.Version = Gen4
out := getPlanOutput(tcase, vschema, render)
Expand Down
Loading

0 comments on commit 4565dca

Please sign in to comment.