Skip to content

Commit 71a8937

Browse files
authored
chore: remove CreateAnotherUserWithUser (#6068)
This was not idiomatic Go!
1 parent b81d846 commit 71a8937

22 files changed

+90
-101
lines changed

cli/create_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ func TestCreate(t *testing.T) {
8787
_ = coderdtest.CreateTemplate(t, client, user.OrganizationID, version.ID)
8888
cmd, root := clitest.New(t, "create", "my-workspace", "-y")
8989

90-
member := coderdtest.CreateAnotherUser(t, client, user.OrganizationID)
90+
member, _ := coderdtest.CreateAnotherUser(t, client, user.OrganizationID)
9191
clitest.SetupConfig(t, member, root)
9292
cmdCtx, done := context.WithTimeout(context.Background(), testutil.WaitLong)
9393
go func() {

cli/delete_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ func TestDelete(t *testing.T) {
7777
adminClient := coderdtest.New(t, &coderdtest.Options{IncludeProvisionerDaemon: true})
7878
adminUser := coderdtest.CreateFirstUser(t, adminClient)
7979
orgID := adminUser.OrganizationID
80-
client := coderdtest.CreateAnotherUser(t, adminClient, orgID)
80+
client, _ := coderdtest.CreateAnotherUser(t, adminClient, orgID)
8181
user, err := client.User(context.Background(), codersdk.Me)
8282
require.NoError(t, err)
8383

cli/userlist_test.go

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -87,12 +87,9 @@ func TestUserShow(t *testing.T) {
8787

8888
t.Run("Table", func(t *testing.T) {
8989
t.Parallel()
90-
ctx := context.Background()
9190
client := coderdtest.New(t, nil)
9291
admin := coderdtest.CreateFirstUser(t, client)
93-
other := coderdtest.CreateAnotherUser(t, client, admin.OrganizationID)
94-
otherUser, err := other.User(ctx, codersdk.Me)
95-
require.NoError(t, err, "fetch other user")
92+
_, otherUser := coderdtest.CreateAnotherUser(t, client, admin.OrganizationID)
9693
cmd, root := clitest.New(t, "users", "show", otherUser.Username)
9794
clitest.SetupConfig(t, client, root)
9895
doneChan := make(chan struct{})
@@ -114,7 +111,7 @@ func TestUserShow(t *testing.T) {
114111
ctx := context.Background()
115112
client := coderdtest.New(t, nil)
116113
admin := coderdtest.CreateFirstUser(t, client)
117-
other := coderdtest.CreateAnotherUser(t, client, admin.OrganizationID)
114+
other, _ := coderdtest.CreateAnotherUser(t, client, admin.OrganizationID)
118115
otherUser, err := other.User(ctx, codersdk.Me)
119116
require.NoError(t, err, "fetch other user")
120117
cmd, root := clitest.New(t, "users", "show", otherUser.Username, "-o", "json")

cli/userstatus_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ func TestUserStatus(t *testing.T) {
1717
t.Parallel()
1818
client := coderdtest.New(t, nil)
1919
admin := coderdtest.CreateFirstUser(t, client)
20-
other := coderdtest.CreateAnotherUser(t, client, admin.OrganizationID)
20+
other, _ := coderdtest.CreateAnotherUser(t, client, admin.OrganizationID)
2121
otherUser, err := other.User(context.Background(), codersdk.Me)
2222
require.NoError(t, err, "fetch user")
2323

coderd/apikey_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ func TestSessionExpiry(t *testing.T) {
137137
// this test it works because we don't copy the value (and we use pointers).
138138
dc.SessionDuration.Value = time.Second
139139

140-
userClient := coderdtest.CreateAnotherUser(t, adminClient, adminUser.OrganizationID)
140+
userClient, _ := coderdtest.CreateAnotherUser(t, adminClient, adminUser.OrganizationID)
141141

142142
// Find the session cookie, and ensure it has the correct expiry.
143143
token := userClient.SessionToken()

coderd/authorize_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ func TestCheckPermissions(t *testing.T) {
2424
})
2525
// Create adminClient, member, and org adminClient
2626
adminUser := coderdtest.CreateFirstUser(t, adminClient)
27-
memberClient := coderdtest.CreateAnotherUser(t, adminClient, adminUser.OrganizationID)
27+
memberClient, _ := coderdtest.CreateAnotherUser(t, adminClient, adminUser.OrganizationID)
2828
memberUser, err := memberClient.User(ctx, codersdk.Me)
2929
require.NoError(t, err)
30-
orgAdminClient := coderdtest.CreateAnotherUser(t, adminClient, adminUser.OrganizationID, rbac.RoleOrgAdmin(adminUser.OrganizationID))
30+
orgAdminClient, _ := coderdtest.CreateAnotherUser(t, adminClient, adminUser.OrganizationID, rbac.RoleOrgAdmin(adminUser.OrganizationID))
3131
orgAdminUser, err := orgAdminClient.User(ctx, codersdk.Me)
3232
require.NoError(t, err)
3333

coderd/coderdtest/coderdtest.go

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -447,12 +447,7 @@ func CreateFirstUser(t *testing.T, client *codersdk.Client) codersdk.CreateFirst
447447
}
448448

449449
// CreateAnotherUser creates and authenticates a new user.
450-
func CreateAnotherUser(t *testing.T, client *codersdk.Client, organizationID uuid.UUID, roles ...string) *codersdk.Client {
451-
userClient, _ := createAnotherUserRetry(t, client, organizationID, 5, roles...)
452-
return userClient
453-
}
454-
455-
func CreateAnotherUserWithUser(t *testing.T, client *codersdk.Client, organizationID uuid.UUID, roles ...string) (*codersdk.Client, codersdk.User) {
450+
func CreateAnotherUser(t *testing.T, client *codersdk.Client, organizationID uuid.UUID, roles ...string) (*codersdk.Client, codersdk.User) {
456451
return createAnotherUserRetry(t, client, organizationID, 5, roles...)
457452
}
458453

coderd/organizations_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ func TestOrganizationByUserAndName(t *testing.T) {
4646
t.Parallel()
4747
client := coderdtest.New(t, nil)
4848
first := coderdtest.CreateFirstUser(t, client)
49-
other := coderdtest.CreateAnotherUser(t, client, first.OrganizationID)
49+
other, _ := coderdtest.CreateAnotherUser(t, client, first.OrganizationID)
5050

5151
ctx, cancel := context.WithTimeout(context.Background(), testutil.WaitLong)
5252
defer cancel()

coderd/roles_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ func TestListRoles(t *testing.T) {
1919
client := coderdtest.New(t, nil)
2020
// Create admin, member, and org admin
2121
admin := coderdtest.CreateFirstUser(t, client)
22-
member := coderdtest.CreateAnotherUser(t, client, admin.OrganizationID)
23-
orgAdmin := coderdtest.CreateAnotherUser(t, client, admin.OrganizationID, rbac.RoleOrgAdmin(admin.OrganizationID))
22+
member, _ := coderdtest.CreateAnotherUser(t, client, admin.OrganizationID)
23+
orgAdmin, _ := coderdtest.CreateAnotherUser(t, client, admin.OrganizationID, rbac.RoleOrgAdmin(admin.OrganizationID))
2424

2525
ctx, cancel := context.WithTimeout(context.Background(), testutil.WaitLong)
2626
t.Cleanup(cancel)

coderd/templateversions_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ func TestTemplateVersion(t *testing.T) {
4747

4848
ctx, _ := testutil.Context(t)
4949

50-
client1, _ := coderdtest.CreateAnotherUserWithUser(t, client, user.OrganizationID)
50+
client1, _ := coderdtest.CreateAnotherUser(t, client, user.OrganizationID)
5151

5252
_, err := client1.TemplateVersion(ctx, version.ID)
5353
require.NoError(t, err)

coderd/users_test.go

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ func TestPostLogin(t *testing.T) {
149149
numLogs++ // add an audit log for create user
150150
numLogs++ // add an audit log for login
151151

152-
member := coderdtest.CreateAnotherUser(t, client, first.OrganizationID)
152+
member, _ := coderdtest.CreateAnotherUser(t, client, first.OrganizationID)
153153
numLogs++ // add an audit log for create user
154154

155155
ctx, cancel := context.WithTimeout(context.Background(), testutil.WaitLong)
@@ -302,7 +302,7 @@ func TestDeleteUser(t *testing.T) {
302302
t.Parallel()
303303
api := coderdtest.New(t, nil)
304304
user := coderdtest.CreateFirstUser(t, api)
305-
_, another := coderdtest.CreateAnotherUserWithUser(t, api, user.OrganizationID)
305+
_, another := coderdtest.CreateAnotherUser(t, api, user.OrganizationID)
306306
err := api.DeleteUser(context.Background(), another.ID)
307307
require.NoError(t, err)
308308
// Attempt to create a user with the same email and username, and delete them again.
@@ -320,7 +320,7 @@ func TestDeleteUser(t *testing.T) {
320320
t.Parallel()
321321
api := coderdtest.New(t, nil)
322322
firstUser := coderdtest.CreateFirstUser(t, api)
323-
client, _ := coderdtest.CreateAnotherUserWithUser(t, api, firstUser.OrganizationID)
323+
client, _ := coderdtest.CreateAnotherUser(t, api, firstUser.OrganizationID)
324324
err := client.DeleteUser(context.Background(), firstUser.UserID)
325325
var apiErr *codersdk.Error
326326
require.ErrorAs(t, err, &apiErr)
@@ -330,7 +330,7 @@ func TestDeleteUser(t *testing.T) {
330330
t.Parallel()
331331
client, _ := coderdtest.NewWithProvisionerCloser(t, nil)
332332
user := coderdtest.CreateFirstUser(t, client)
333-
anotherClient, another := coderdtest.CreateAnotherUserWithUser(t, client, user.OrganizationID)
333+
anotherClient, another := coderdtest.CreateAnotherUser(t, client, user.OrganizationID)
334334
version := coderdtest.CreateTemplateVersion(t, client, user.OrganizationID, nil)
335335
coderdtest.AwaitTemplateVersionJob(t, client, version.ID)
336336
template := coderdtest.CreateTemplate(t, client, user.OrganizationID, version.ID)
@@ -452,8 +452,8 @@ func TestPostUsers(t *testing.T) {
452452
t.Parallel()
453453
client := coderdtest.New(t, nil)
454454
first := coderdtest.CreateFirstUser(t, client)
455-
notInOrg := coderdtest.CreateAnotherUser(t, client, first.OrganizationID)
456-
other := coderdtest.CreateAnotherUser(t, client, first.OrganizationID, rbac.RoleOwner(), rbac.RoleMember())
455+
notInOrg, _ := coderdtest.CreateAnotherUser(t, client, first.OrganizationID)
456+
other, _ := coderdtest.CreateAnotherUser(t, client, first.OrganizationID, rbac.RoleOwner(), rbac.RoleMember())
457457

458458
ctx, cancel := context.WithTimeout(context.Background(), testutil.WaitLong)
459459
defer cancel()
@@ -511,7 +511,7 @@ func TestPostUsers(t *testing.T) {
511511
firstUser, err := client.User(ctx, firstUserResp.UserID.String())
512512
require.NoError(t, err)
513513

514-
_ = coderdtest.CreateAnotherUser(t, client, firstUserResp.OrganizationID)
514+
_, _ = coderdtest.CreateAnotherUser(t, client, firstUserResp.OrganizationID)
515515

516516
allUsersRes, err := client.Users(ctx, codersdk.UsersRequest{})
517517
require.NoError(t, err)
@@ -605,7 +605,7 @@ func TestUpdateUserPassword(t *testing.T) {
605605
t.Parallel()
606606
client := coderdtest.New(t, nil)
607607
admin := coderdtest.CreateFirstUser(t, client)
608-
member := coderdtest.CreateAnotherUser(t, client, admin.OrganizationID)
608+
member, _ := coderdtest.CreateAnotherUser(t, client, admin.OrganizationID)
609609

610610
ctx, cancel := context.WithTimeout(context.Background(), testutil.WaitLong)
611611
defer cancel()
@@ -652,7 +652,7 @@ func TestUpdateUserPassword(t *testing.T) {
652652
numLogs++ // add an audit log for user create
653653
numLogs++ // add an audit log for login
654654

655-
member := coderdtest.CreateAnotherUser(t, client, admin.OrganizationID)
655+
member, _ := coderdtest.CreateAnotherUser(t, client, admin.OrganizationID)
656656
numLogs++ // add an audit log for user create
657657

658658
ctx, cancel := context.WithTimeout(context.Background(), testutil.WaitLong)
@@ -673,7 +673,7 @@ func TestUpdateUserPassword(t *testing.T) {
673673
t.Parallel()
674674
client := coderdtest.New(t, nil)
675675
admin := coderdtest.CreateFirstUser(t, client)
676-
member := coderdtest.CreateAnotherUser(t, client, admin.OrganizationID)
676+
member, _ := coderdtest.CreateAnotherUser(t, client, admin.OrganizationID)
677677

678678
ctx, cancel := context.WithTimeout(context.Background(), testutil.WaitLong)
679679
defer cancel()
@@ -784,14 +784,14 @@ func TestGrantSiteRoles(t *testing.T) {
784784

785785
admin := coderdtest.New(t, nil)
786786
first := coderdtest.CreateFirstUser(t, admin)
787-
member := coderdtest.CreateAnotherUser(t, admin, first.OrganizationID)
788-
orgAdmin := coderdtest.CreateAnotherUser(t, admin, first.OrganizationID, rbac.RoleOrgAdmin(first.OrganizationID))
787+
member, _ := coderdtest.CreateAnotherUser(t, admin, first.OrganizationID)
788+
orgAdmin, _ := coderdtest.CreateAnotherUser(t, admin, first.OrganizationID, rbac.RoleOrgAdmin(first.OrganizationID))
789789
randOrg, err := admin.CreateOrganization(ctx, codersdk.CreateOrganizationRequest{
790790
Name: "random",
791791
})
792792
require.NoError(t, err)
793-
_, randOrgUser := coderdtest.CreateAnotherUserWithUser(t, admin, randOrg.ID, rbac.RoleOrgAdmin(randOrg.ID))
794-
userAdmin := coderdtest.CreateAnotherUser(t, admin, first.OrganizationID, rbac.RoleUserAdmin())
793+
_, randOrgUser := coderdtest.CreateAnotherUser(t, admin, randOrg.ID, rbac.RoleOrgAdmin(randOrg.ID))
794+
userAdmin, _ := coderdtest.CreateAnotherUser(t, admin, first.OrganizationID, rbac.RoleUserAdmin())
795795

796796
const newUser = "newUser"
797797

@@ -901,7 +901,7 @@ func TestGrantSiteRoles(t *testing.T) {
901901
if c.OrgID != uuid.Nil {
902902
orgID = c.OrgID
903903
}
904-
_, newUser := coderdtest.CreateAnotherUserWithUser(t, admin, orgID)
904+
_, newUser := coderdtest.CreateAnotherUser(t, admin, orgID)
905905
c.AssignToUser = newUser.ID.String()
906906
}
907907

@@ -962,7 +962,7 @@ func TestPutUserSuspend(t *testing.T) {
962962
t.Parallel()
963963
client := coderdtest.New(t, nil)
964964
me := coderdtest.CreateFirstUser(t, client)
965-
_, user := coderdtest.CreateAnotherUserWithUser(t, client, me.OrganizationID, rbac.RoleOwner())
965+
_, user := coderdtest.CreateAnotherUser(t, client, me.OrganizationID, rbac.RoleOwner())
966966

967967
ctx, cancel := context.WithTimeout(context.Background(), testutil.WaitLong)
968968
defer cancel()
@@ -981,7 +981,7 @@ func TestPutUserSuspend(t *testing.T) {
981981
numLogs++ // add an audit log for user create
982982
numLogs++ // add an audit log for login
983983

984-
_, user := coderdtest.CreateAnotherUserWithUser(t, client, me.OrganizationID)
984+
_, user := coderdtest.CreateAnotherUser(t, client, me.OrganizationID)
985985
numLogs++ // add an audit log for user create
986986

987987
ctx, cancel := context.WithTimeout(context.Background(), testutil.WaitLong)
@@ -1085,7 +1085,7 @@ func TestUsersFilter(t *testing.T) {
10851085
if i%3 == 0 {
10861086
roles = append(roles, "auditor")
10871087
}
1088-
userClient := coderdtest.CreateAnotherUser(t, client, first.OrganizationID, roles...)
1088+
userClient, _ := coderdtest.CreateAnotherUser(t, client, first.OrganizationID, roles...)
10891089
user, err := userClient.User(ctx, codersdk.Me)
10901090
require.NoError(t, err, "fetch me")
10911091

coderd/workspaceapps_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,7 @@ func TestWorkspaceAppsProxyPath(t *testing.T) {
337337
t.Run("NoAccessShould404", func(t *testing.T) {
338338
t.Parallel()
339339

340-
userClient := coderdtest.CreateAnotherUser(t, client, firstUser.OrganizationID, rbac.RoleMember())
340+
userClient, _ := coderdtest.CreateAnotherUser(t, client, firstUser.OrganizationID, rbac.RoleMember())
341341
userClient.HTTPClient.CheckRedirect = client.HTTPClient.CheckRedirect
342342
userClient.HTTPClient.Transport = client.HTTPClient.Transport
343343

@@ -765,7 +765,7 @@ func TestWorkspaceAppsProxySubdomain(t *testing.T) {
765765
t.Run("NoAccessShould401", func(t *testing.T) {
766766
t.Parallel()
767767

768-
userClient := coderdtest.CreateAnotherUser(t, client, firstUser.OrganizationID, rbac.RoleMember())
768+
userClient, _ := coderdtest.CreateAnotherUser(t, client, firstUser.OrganizationID, rbac.RoleMember())
769769
userClient.HTTPClient.CheckRedirect = client.HTTPClient.CheckRedirect
770770
userClient.HTTPClient.Transport = client.HTTPClient.Transport
771771

coderd/workspacebuilds_test.go

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -185,13 +185,11 @@ func TestWorkspaceBuilds(t *testing.T) {
185185
t.Parallel()
186186
client := coderdtest.New(t, &coderdtest.Options{IncludeProvisionerDaemon: true})
187187
first := coderdtest.CreateFirstUser(t, client)
188-
second := coderdtest.CreateAnotherUser(t, client, first.OrganizationID, "owner")
188+
second, secondUser := coderdtest.CreateAnotherUser(t, client, first.OrganizationID, "owner")
189189

190190
ctx, cancel := context.WithTimeout(context.Background(), testutil.WaitLong)
191191
defer cancel()
192192

193-
secondUser, err := second.User(ctx, codersdk.Me)
194-
require.NoError(t, err, "fetch me")
195193
version := coderdtest.CreateTemplateVersion(t, client, first.OrganizationID, nil)
196194
template := coderdtest.CreateTemplate(t, client, first.OrganizationID, version.ID)
197195
coderdtest.AwaitTemplateVersionJob(t, client, version.ID)
@@ -307,7 +305,7 @@ func TestWorkspaceBuildsProvisionerState(t *testing.T) {
307305

308306
// A regular user on the very same template must not be able to modify the
309307
// state.
310-
regularUser := coderdtest.CreateAnotherUser(t, client, first.OrganizationID)
308+
regularUser, _ := coderdtest.CreateAnotherUser(t, client, first.OrganizationID)
311309

312310
workspace = coderdtest.CreateWorkspace(t, regularUser, first.OrganizationID, template.ID)
313311
coderdtest.AwaitWorkspaceBuildJob(t, regularUser, workspace.LatestBuild.ID)
@@ -425,7 +423,7 @@ func TestPatchCancelWorkspaceBuild(t *testing.T) {
425423
coderdtest.AwaitTemplateVersionJob(t, client, version.ID)
426424
template := coderdtest.CreateTemplate(t, client, owner.OrganizationID, version.ID)
427425

428-
userClient := coderdtest.CreateAnotherUser(t, client, owner.OrganizationID)
426+
userClient, _ := coderdtest.CreateAnotherUser(t, client, owner.OrganizationID)
429427
workspace := coderdtest.CreateWorkspace(t, userClient, owner.OrganizationID, template.ID)
430428
var build codersdk.WorkspaceBuild
431429

coderd/workspaces_test.go

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ func TestAdminViewAllWorkspaces(t *testing.T) {
175175

176176
// This other user is not in the first user's org. Since other is an admin, they can
177177
// still see the "first" user's workspace.
178-
otherOwner := coderdtest.CreateAnotherUser(t, client, otherOrg.ID, rbac.RoleOwner())
178+
otherOwner, _ := coderdtest.CreateAnotherUser(t, client, otherOrg.ID, rbac.RoleOwner())
179179
otherWorkspaces, err := otherOwner.Workspaces(ctx, codersdk.WorkspaceFilter{})
180180
require.NoError(t, err, "(other) fetch workspaces")
181181

@@ -185,7 +185,7 @@ func TestAdminViewAllWorkspaces(t *testing.T) {
185185
require.ElementsMatch(t, otherWorkspaces.Workspaces, firstWorkspaces.Workspaces)
186186
require.Equal(t, len(firstWorkspaces.Workspaces), 1, "should be 1 workspace present")
187187

188-
memberView := coderdtest.CreateAnotherUser(t, client, otherOrg.ID)
188+
memberView, _ := coderdtest.CreateAnotherUser(t, client, otherOrg.ID)
189189
memberViewWorkspaces, err := memberView.Workspaces(ctx, codersdk.WorkspaceFilter{})
190190
require.NoError(t, err, "(member) fetch workspaces")
191191
require.Equal(t, 0, len(memberViewWorkspaces.Workspaces), "member in other org should see 0 workspaces")
@@ -216,7 +216,7 @@ func TestPostWorkspacesByOrganization(t *testing.T) {
216216
client := coderdtest.New(t, nil)
217217
first := coderdtest.CreateFirstUser(t, client)
218218

219-
other := coderdtest.CreateAnotherUser(t, client, first.OrganizationID, rbac.RoleMember(), rbac.RoleOwner())
219+
other, _ := coderdtest.CreateAnotherUser(t, client, first.OrganizationID, rbac.RoleMember(), rbac.RoleOwner())
220220

221221
ctx, cancel := context.WithTimeout(context.Background(), testutil.WaitLong)
222222
defer cancel()
@@ -510,11 +510,10 @@ func TestWorkspaceFilter(t *testing.T) {
510510

511511
users := make([]coderUser, 0)
512512
for i := 0; i < 10; i++ {
513-
userClient := coderdtest.CreateAnotherUser(t, client, first.OrganizationID, rbac.RoleOwner())
514-
user, err := userClient.User(ctx, codersdk.Me)
515-
require.NoError(t, err, "fetch me")
513+
userClient, user := coderdtest.CreateAnotherUser(t, client, first.OrganizationID, rbac.RoleOwner())
516514

517515
if i%3 == 0 {
516+
var err error
518517
user, err = client.UpdateUserProfile(ctx, user.ID.String(), codersdk.UpdateUserProfileRequest{
519518
Username: strings.ToUpper(user.Username),
520519
})

enterprise/cli/groupedit_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ func TestGroupEdit(t *testing.T) {
3333
})
3434

3535
ctx, _ := testutil.Context(t)
36-
_, user1 := coderdtest.CreateAnotherUserWithUser(t, client, admin.OrganizationID)
37-
_, user2 := coderdtest.CreateAnotherUserWithUser(t, client, admin.OrganizationID)
38-
_, user3 := coderdtest.CreateAnotherUserWithUser(t, client, admin.OrganizationID)
36+
_, user1 := coderdtest.CreateAnotherUser(t, client, admin.OrganizationID)
37+
_, user2 := coderdtest.CreateAnotherUser(t, client, admin.OrganizationID)
38+
_, user3 := coderdtest.CreateAnotherUser(t, client, admin.OrganizationID)
3939

4040
group, err := client.CreateGroup(ctx, admin.OrganizationID, codersdk.CreateGroupRequest{
4141
Name: "alpha",

enterprise/cli/grouplist_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ func TestGroupList(t *testing.T) {
3131
})
3232

3333
ctx, _ := testutil.Context(t)
34-
_, user1 := coderdtest.CreateAnotherUserWithUser(t, client, admin.OrganizationID)
35-
_, user2 := coderdtest.CreateAnotherUserWithUser(t, client, admin.OrganizationID)
34+
_, user1 := coderdtest.CreateAnotherUser(t, client, admin.OrganizationID)
35+
_, user2 := coderdtest.CreateAnotherUser(t, client, admin.OrganizationID)
3636

3737
// We intentionally create the first group as beta so that we
3838
// can assert that things are being sorted by name intentionally

enterprise/coderd/appearance_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ func TestServiceBanners(t *testing.T) {
4141
require.NoError(t, err)
4242
require.False(t, sb.ServiceBanner.Enabled)
4343

44-
basicUserClient := coderdtest.CreateAnotherUser(t, adminClient, adminUser.OrganizationID)
44+
basicUserClient, _ := coderdtest.CreateAnotherUser(t, adminClient, adminUser.OrganizationID)
4545

4646
// Regular user should be unable to set the banner
4747
sb.ServiceBanner.Enabled = true

enterprise/coderd/authorize_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,10 @@ func TestCheckACLPermissions(t *testing.T) {
3434
},
3535
})
3636

37-
memberClient := coderdtest.CreateAnotherUser(t, adminClient, adminUser.OrganizationID)
37+
memberClient, _ := coderdtest.CreateAnotherUser(t, adminClient, adminUser.OrganizationID)
3838
memberUser, err := memberClient.User(ctx, codersdk.Me)
3939
require.NoError(t, err)
40-
orgAdminClient := coderdtest.CreateAnotherUser(t, adminClient, adminUser.OrganizationID, rbac.RoleOrgAdmin(adminUser.OrganizationID))
40+
orgAdminClient, _ := coderdtest.CreateAnotherUser(t, adminClient, adminUser.OrganizationID, rbac.RoleOrgAdmin(adminUser.OrganizationID))
4141
orgAdminUser, err := orgAdminClient.User(ctx, codersdk.Me)
4242
require.NoError(t, err)
4343

0 commit comments

Comments
 (0)