Skip to content

Commit 9f93752

Browse files
committed
fix some tests
1 parent de9c2e9 commit 9f93752

File tree

6 files changed

+19
-19
lines changed

6 files changed

+19
-19
lines changed

enterprise/cli/organizationmembers_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ func TestEnterpriseListOrganizationMembers(t *testing.T) {
3636

3737
ctx := testutil.Context(t, testutil.WaitMedium)
3838
//nolint:gocritic // only owners can patch roles
39-
customRole, err := ownerClient.PatchOrganizationRole(ctx, owner.OrganizationID, codersdk.Role{
39+
customRole, err := ownerClient.PatchOrganizationRole(ctx, codersdk.Role{
4040
Name: "custom",
4141
OrganizationID: owner.OrganizationID.String(),
4242
DisplayName: "Custom Role",
@@ -89,7 +89,7 @@ func TestAssignOrganizationMemberRole(t *testing.T) {
8989

9090
ctx := testutil.Context(t, testutil.WaitMedium)
9191
// nolint:gocritic // requires owner role to create
92-
customRole, err := ownerClient.PatchOrganizationRole(ctx, owner.OrganizationID, codersdk.Role{
92+
customRole, err := ownerClient.PatchOrganizationRole(ctx, codersdk.Role{
9393
Name: "custom-role",
9494
OrganizationID: owner.OrganizationID.String(),
9595
DisplayName: "Custom Role",

enterprise/cli/templatecreate_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ func TestTemplateCreate(t *testing.T) {
168168
ctx := testutil.Context(t, testutil.WaitMedium)
169169

170170
//nolint:gocritic // owner required to make custom roles
171-
orgTemplateAdminRole, err := ownerClient.PatchOrganizationRole(ctx, secondOrg.ID, codersdk.Role{
171+
orgTemplateAdminRole, err := ownerClient.PatchOrganizationRole(ctx, codersdk.Role{
172172
Name: "org-template-admin",
173173
OrganizationID: secondOrg.ID.String(),
174174
OrganizationPermissions: codersdk.CreatePermissions(map[codersdk.RBACResource][]codersdk.RBACAction{

enterprise/coderd/roles_test.go

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ func TestCustomOrganizationRole(t *testing.T) {
5757
ctx := testutil.Context(t, testutil.WaitMedium)
5858

5959
//nolint:gocritic // owner is required for this
60-
role, err := owner.PatchOrganizationRole(ctx, first.OrganizationID, templateAdminCustom(first.OrganizationID))
60+
role, err := owner.PatchOrganizationRole(ctx, templateAdminCustom(first.OrganizationID))
6161
require.NoError(t, err, "upsert role")
6262

6363
// Assign the custom template admin role
@@ -111,7 +111,7 @@ func TestCustomOrganizationRole(t *testing.T) {
111111
ctx := testutil.Context(t, testutil.WaitMedium)
112112

113113
//nolint:gocritic // owner is required for this
114-
role, err := owner.PatchOrganizationRole(ctx, first.OrganizationID, templateAdminCustom(first.OrganizationID))
114+
role, err := owner.PatchOrganizationRole(ctx, templateAdminCustom(first.OrganizationID))
115115
require.NoError(t, err, "upsert role")
116116

117117
// Remove the license to block enterprise functionality
@@ -124,7 +124,7 @@ func TestCustomOrganizationRole(t *testing.T) {
124124
}
125125

126126
// Verify functionality is lost
127-
_, err = owner.PatchOrganizationRole(ctx, first.OrganizationID, templateAdminCustom(first.OrganizationID))
127+
_, err = owner.PatchOrganizationRole(ctx, templateAdminCustom(first.OrganizationID))
128128
require.ErrorContains(t, err, "roles are not enabled")
129129

130130
// Assign the custom template admin role
@@ -152,7 +152,7 @@ func TestCustomOrganizationRole(t *testing.T) {
152152

153153
ctx := testutil.Context(t, testutil.WaitMedium)
154154
//nolint:gocritic // owner is required for this
155-
role, err := owner.PatchOrganizationRole(ctx, first.OrganizationID, templateAdminCustom(first.OrganizationID))
155+
role, err := owner.PatchOrganizationRole(ctx, templateAdminCustom(first.OrganizationID))
156156
require.NoError(t, err, "upsert role")
157157

158158
// Assign the custom template admin role
@@ -169,7 +169,7 @@ func TestCustomOrganizationRole(t *testing.T) {
169169
newRole.SitePermissions = nil
170170
newRole.OrganizationPermissions = nil
171171
newRole.UserPermissions = nil
172-
_, err = owner.PatchOrganizationRole(ctx, first.OrganizationID, newRole)
172+
_, err = owner.PatchOrganizationRole(ctx, newRole)
173173
require.NoError(t, err, "upsert role with override")
174174

175175
// The role should no longer have template perms
@@ -203,7 +203,7 @@ func TestCustomOrganizationRole(t *testing.T) {
203203
ctx := testutil.Context(t, testutil.WaitMedium)
204204

205205
//nolint:gocritic // owner is required for this
206-
_, err := owner.PatchOrganizationRole(ctx, first.OrganizationID, codersdk.Role{
206+
_, err := owner.PatchOrganizationRole(ctx, codersdk.Role{
207207
Name: "Bad_Name", // No underscores allowed
208208
DisplayName: "Testing Purposes",
209209
OrganizationID: first.OrganizationID.String(),
@@ -218,7 +218,7 @@ func TestCustomOrganizationRole(t *testing.T) {
218218
t.Parallel()
219219
dv := coderdtest.DeploymentValues(t)
220220
dv.Experiments = []string{string(codersdk.ExperimentCustomRoles)}
221-
owner, first := coderdenttest.New(t, &coderdenttest.Options{
221+
owner, _ := coderdenttest.New(t, &coderdenttest.Options{
222222
Options: &coderdtest.Options{
223223
DeploymentValues: dv,
224224
},
@@ -232,7 +232,7 @@ func TestCustomOrganizationRole(t *testing.T) {
232232
ctx := testutil.Context(t, testutil.WaitMedium)
233233

234234
//nolint:gocritic // owner is required for this
235-
_, err := owner.PatchOrganizationRole(ctx, first.OrganizationID, codersdk.Role{
235+
_, err := owner.PatchOrganizationRole(ctx, codersdk.Role{
236236
Name: "owner", // Reserved
237237
DisplayName: "Testing Purposes",
238238
SitePermissions: nil,
@@ -246,7 +246,7 @@ func TestCustomOrganizationRole(t *testing.T) {
246246
t.Parallel()
247247
dv := coderdtest.DeploymentValues(t)
248248
dv.Experiments = []string{string(codersdk.ExperimentCustomRoles)}
249-
owner, first := coderdenttest.New(t, &coderdenttest.Options{
249+
owner, _ := coderdenttest.New(t, &coderdenttest.Options{
250250
Options: &coderdtest.Options{
251251
DeploymentValues: dv,
252252
},
@@ -260,7 +260,7 @@ func TestCustomOrganizationRole(t *testing.T) {
260260
ctx := testutil.Context(t, testutil.WaitMedium)
261261

262262
//nolint:gocritic // owner is required for this
263-
_, err := owner.PatchOrganizationRole(ctx, first.OrganizationID, templateAdminCustom(uuid.New()))
263+
_, err := owner.PatchOrganizationRole(ctx, templateAdminCustom(uuid.New()))
264264
require.ErrorContains(t, err, "does not match")
265265
})
266266

@@ -291,7 +291,7 @@ func TestCustomOrganizationRole(t *testing.T) {
291291
}
292292

293293
//nolint:gocritic // owner is required for this
294-
_, err := owner.PatchOrganizationRole(ctx, first.OrganizationID, siteRole)
294+
_, err := owner.PatchOrganizationRole(ctx, siteRole)
295295
require.ErrorContains(t, err, "site wide permissions")
296296

297297
userRole := templateAdminCustom(first.OrganizationID)
@@ -303,7 +303,7 @@ func TestCustomOrganizationRole(t *testing.T) {
303303
}
304304

305305
//nolint:gocritic // owner is required for this
306-
_, err = owner.PatchOrganizationRole(ctx, first.OrganizationID, userRole)
306+
_, err = owner.PatchOrganizationRole(ctx, userRole)
307307
require.ErrorContains(t, err, "not allowed to assign user permissions")
308308
})
309309

@@ -328,7 +328,7 @@ func TestCustomOrganizationRole(t *testing.T) {
328328
newRole.OrganizationID = "0000" // This is not a valid uuid
329329

330330
//nolint:gocritic // owner is required for this
331-
_, err := owner.PatchOrganizationRole(ctx, first.OrganizationID, newRole)
331+
_, err := owner.PatchOrganizationRole(ctx, newRole)
332332
require.ErrorContains(t, err, "Invalid request")
333333
})
334334
}

enterprise/coderd/templates_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -751,7 +751,7 @@ func TestTemplates(t *testing.T) {
751751
})
752752

753753
//nolint:gocritic // owner required to make custom roles
754-
orgTemplateAdminRole, err := ownerClient.PatchOrganizationRole(ctx, secondOrg.ID, codersdk.Role{
754+
orgTemplateAdminRole, err := ownerClient.PatchOrganizationRole(ctx, codersdk.Role{
755755
Name: "org-template-admin",
756756
OrganizationID: secondOrg.ID.String(),
757757
OrganizationPermissions: codersdk.CreatePermissions(map[codersdk.RBACResource][]codersdk.RBACAction{

enterprise/coderd/userauth_test.go

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

706706
ctx := testutil.Context(t, testutil.WaitShort)
707707
//nolint:gocritic // owner required
708-
customRole, err := ownerClient.PatchOrganizationRole(ctx, owner.OrganizationID, codersdk.Role{
708+
customRole, err := ownerClient.PatchOrganizationRole(ctx, codersdk.Role{
709709
Name: "custom-role",
710710
OrganizationID: owner.OrganizationID.String(),
711711
OrganizationPermissions: []codersdk.Permission{},

enterprise/coderd/users_test.go

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

272272
ctx := testutil.Context(t, testutil.WaitShort)
273273
// Create a custom role as an organization admin that allows making templates.
274-
auditorRole, err := client.PatchOrganizationRole(ctx, owner.OrganizationID, codersdk.Role{
274+
auditorRole, err := client.PatchOrganizationRole(ctx, codersdk.Role{
275275
Name: "org-template-admin",
276276
OrganizationID: owner.OrganizationID.String(),
277277
DisplayName: "Template Admin",

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy