multitenant: add TestTenants() helper to TestServer#88476
multitenant: add TestTenants() helper to TestServer#88476craig[bot] merged 1 commit intocockroachdb:masterfrom
Conversation
This patch adds a helper method for accessing information about the tenant(s) that were probabilistically created with the TestServer. Release note: None
ajstorm
left a comment
There was a problem hiding this comment.
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).
msbutler
left a comment
There was a problem hiding this comment.
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