-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
test: make it easier to run tests without a main keyspace #17501
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Andres Taylor <[email protected]>
Review ChecklistHello reviewers! 👋 Please follow this checklist when reviewing this Pull Request. General
Tests
Documentation
New flags
If a workflow is added or modified:
Backward compatibility
|
Signed-off-by: Andres Taylor <[email protected]>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #17501 +/- ##
=======================================
Coverage 67.68% 67.69%
=======================================
Files 1584 1584
Lines 254466 254511 +45
=======================================
+ Hits 172235 172289 +54
+ Misses 82231 82222 -9 ☔ View full report in Codecov by Sentry. |
return vw.V.Keyspaces["main"].Keyspace, nil | ||
return vw.AnyKeyspace() | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use vw. Vcursor
return vw.SelectedKeyspace() | ||
ks, found := vw.V.Keyspaces["main"] | ||
if found { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here
use vw. Vcursor
return vw.V.Keyspaces["main"].Keyspace, nil | ||
return vw.AnyKeyspace() | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same
use vw. Vcursor
destKeyspace, destTabletType, _, err := topoproto.ParseDestination(tab.Qualifier.String(), topodatapb.TabletType_PRIMARY) | ||
if err != nil { | ||
return nil, err | ||
} | ||
mirrorRule, err := vs.V.FindMirrorRule(destKeyspace, tab.Name.String(), destTabletType) | ||
mirrorRule, err := vw.V.FindMirrorRule(destKeyspace, tab.Name.String(), destTabletType) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
possibly duplicate logic,
we now have vw. Vcursor
, that could be used here.
Description
When using keyspaces in tests, the current schema wrapper we use makes it hard if we are missing a
main
keyspace. This change makes it easier to handle situations without this keyspace.Checklist