@@ -57,7 +57,7 @@ func TestCustomOrganizationRole(t *testing.T) {
57
57
ctx := testutil .Context (t , testutil .WaitMedium )
58
58
59
59
//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 ))
61
61
require .NoError (t , err , "upsert role" )
62
62
63
63
// Assign the custom template admin role
@@ -111,7 +111,7 @@ func TestCustomOrganizationRole(t *testing.T) {
111
111
ctx := testutil .Context (t , testutil .WaitMedium )
112
112
113
113
//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 ))
115
115
require .NoError (t , err , "upsert role" )
116
116
117
117
// Remove the license to block enterprise functionality
@@ -124,7 +124,7 @@ func TestCustomOrganizationRole(t *testing.T) {
124
124
}
125
125
126
126
// Verify functionality is lost
127
- _ , err = owner .PatchOrganizationRole (ctx , first . OrganizationID , templateAdminCustom (first .OrganizationID ))
127
+ _ , err = owner .PatchOrganizationRole (ctx , templateAdminCustom (first .OrganizationID ))
128
128
require .ErrorContains (t , err , "roles are not enabled" )
129
129
130
130
// Assign the custom template admin role
@@ -152,7 +152,7 @@ func TestCustomOrganizationRole(t *testing.T) {
152
152
153
153
ctx := testutil .Context (t , testutil .WaitMedium )
154
154
//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 ))
156
156
require .NoError (t , err , "upsert role" )
157
157
158
158
// Assign the custom template admin role
@@ -169,7 +169,7 @@ func TestCustomOrganizationRole(t *testing.T) {
169
169
newRole .SitePermissions = nil
170
170
newRole .OrganizationPermissions = nil
171
171
newRole .UserPermissions = nil
172
- _ , err = owner .PatchOrganizationRole (ctx , first . OrganizationID , newRole )
172
+ _ , err = owner .PatchOrganizationRole (ctx , newRole )
173
173
require .NoError (t , err , "upsert role with override" )
174
174
175
175
// The role should no longer have template perms
@@ -203,7 +203,7 @@ func TestCustomOrganizationRole(t *testing.T) {
203
203
ctx := testutil .Context (t , testutil .WaitMedium )
204
204
205
205
//nolint:gocritic // owner is required for this
206
- _ , err := owner .PatchOrganizationRole (ctx , first . OrganizationID , codersdk.Role {
206
+ _ , err := owner .PatchOrganizationRole (ctx , codersdk.Role {
207
207
Name : "Bad_Name" , // No underscores allowed
208
208
DisplayName : "Testing Purposes" ,
209
209
OrganizationID : first .OrganizationID .String (),
@@ -218,7 +218,7 @@ func TestCustomOrganizationRole(t *testing.T) {
218
218
t .Parallel ()
219
219
dv := coderdtest .DeploymentValues (t )
220
220
dv .Experiments = []string {string (codersdk .ExperimentCustomRoles )}
221
- owner , first := coderdenttest .New (t , & coderdenttest.Options {
221
+ owner , _ := coderdenttest .New (t , & coderdenttest.Options {
222
222
Options : & coderdtest.Options {
223
223
DeploymentValues : dv ,
224
224
},
@@ -232,7 +232,7 @@ func TestCustomOrganizationRole(t *testing.T) {
232
232
ctx := testutil .Context (t , testutil .WaitMedium )
233
233
234
234
//nolint:gocritic // owner is required for this
235
- _ , err := owner .PatchOrganizationRole (ctx , first . OrganizationID , codersdk.Role {
235
+ _ , err := owner .PatchOrganizationRole (ctx , codersdk.Role {
236
236
Name : "owner" , // Reserved
237
237
DisplayName : "Testing Purposes" ,
238
238
SitePermissions : nil ,
@@ -246,7 +246,7 @@ func TestCustomOrganizationRole(t *testing.T) {
246
246
t .Parallel ()
247
247
dv := coderdtest .DeploymentValues (t )
248
248
dv .Experiments = []string {string (codersdk .ExperimentCustomRoles )}
249
- owner , first := coderdenttest .New (t , & coderdenttest.Options {
249
+ owner , _ := coderdenttest .New (t , & coderdenttest.Options {
250
250
Options : & coderdtest.Options {
251
251
DeploymentValues : dv ,
252
252
},
@@ -260,7 +260,7 @@ func TestCustomOrganizationRole(t *testing.T) {
260
260
ctx := testutil .Context (t , testutil .WaitMedium )
261
261
262
262
//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 ()))
264
264
require .ErrorContains (t , err , "does not match" )
265
265
})
266
266
@@ -291,7 +291,7 @@ func TestCustomOrganizationRole(t *testing.T) {
291
291
}
292
292
293
293
//nolint:gocritic // owner is required for this
294
- _ , err := owner .PatchOrganizationRole (ctx , first . OrganizationID , siteRole )
294
+ _ , err := owner .PatchOrganizationRole (ctx , siteRole )
295
295
require .ErrorContains (t , err , "site wide permissions" )
296
296
297
297
userRole := templateAdminCustom (first .OrganizationID )
@@ -303,7 +303,7 @@ func TestCustomOrganizationRole(t *testing.T) {
303
303
}
304
304
305
305
//nolint:gocritic // owner is required for this
306
- _ , err = owner .PatchOrganizationRole (ctx , first . OrganizationID , userRole )
306
+ _ , err = owner .PatchOrganizationRole (ctx , userRole )
307
307
require .ErrorContains (t , err , "not allowed to assign user permissions" )
308
308
})
309
309
@@ -328,7 +328,7 @@ func TestCustomOrganizationRole(t *testing.T) {
328
328
newRole .OrganizationID = "0000" // This is not a valid uuid
329
329
330
330
//nolint:gocritic // owner is required for this
331
- _ , err := owner .PatchOrganizationRole (ctx , first . OrganizationID , newRole )
331
+ _ , err := owner .PatchOrganizationRole (ctx , newRole )
332
332
require .ErrorContains (t , err , "Invalid request" )
333
333
})
334
334
}
0 commit comments