- Notifications
You must be signed in to change notification settings - Fork927
chore: assign user to multiple orgs in coderdtest user create#13867
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
third := coderdtest.CreateOrganization(t, client, coderdtest.CreateOrganizationOptions{}) | ||
// Assign the user to 3 orgs in this 1 statement | ||
_, user := coderdtest.CreateAnotherUser(t, client, owner.OrganizationID, rbac.ScopedRoleOrgMember(second.ID), rbac.ScopedRoleOrgMember(third.ID)) |
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.
This is the result of this change. This line creates a new user and assigns them to 3 organizations. Much easier than doing this manually.
Log: api.Logger, | ||
Request: r, | ||
Action: database.AuditActionCreate, | ||
OrganizationID: organization.ID, |
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.
Noticed these org ID's were missing in the audit logs
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.
great addition to the test suite
a588ec5
intomainUh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
CreateAnotherUser
can now assign users to multiple orgs. As I write multi-org tests, this is super useful to reduce LoC.