-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
multitenant: add TestTenants() helper to TestServer #88476
Conversation
This patch adds a helper method for accessing information about the tenant(s) that were probabilistically created with the TestServer. Release note: None
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.
One nit for your consideration.
Reviewable status:
complete! 1 of 0 LGTMs obtained (waiting on @knz, @msbutler, and @smg260)
pkg/server/testserver.go
line 505 at r1 (raw file):
// TestTenants provides information to tenant(s) that _may_ have been created func (ts *TestServer) TestTenants() []serverutils.TestTenantInterface {
Nit: Rather than return the whole slice, does it make more sense to have the function take an integer argument and only return the test tenant in question (or nil if the index exceeds the size of the slice)? I'd imagine that in most cases, only a specific test tenant would be needed by the caller (this is definitely the case now, as there will only ever be one test tenant).
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.
Reviewable status:
complete! 1 of 0 LGTMs obtained (waiting on @ajstorm, @knz, and @smg260)
pkg/server/testserver.go
line 505 at r1 (raw file):
Previously, ajstorm (Adam Storm) wrote…
Nit: Rather than return the whole slice, does it make more sense to have the function take an integer argument and only return the test tenant in question (or nil if the index exceeds the size of the slice)? I'd imagine that in most cases, only a specific test tenant would be needed by the caller (this is definitely the case now, as there will only ever be one test tenant).
yeah good q: i'm tempted to keep it as is, because I'm unsure how a test user would know which tenant they'd want, and therefore, which index they'd use. Once the testServer starts generating multiple tenants per server, I imagine this func could be refactored.
TFTR! |
Build succeeded: |
This patch adds a helper method for accessing information about the tenant(s) that were probabilistically created with the TestServer.
Release note: None