Skip to content

Commit aea3688

Browse files
committed
remove db from tests that do no need it
1 parent 2452967 commit aea3688

19 files changed

+4
-281
lines changed

enterprise/cli/create_test.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,8 @@ func TestEnterpriseCreate(t *testing.T) {
3737
// setupMultipleOrganizations creates an extra organization, assigns a member
3838
// both organizations, and optionally creates templates in each organization.
3939
setupMultipleOrganizations := func(t *testing.T, args setupArgs) setupData {
40-
dv := coderdtest.DeploymentValues(t)
4140
ownerClient, first := coderdenttest.New(t, &coderdenttest.Options{
4241
Options: &coderdtest.Options{
43-
DeploymentValues: dv,
4442
// This only affects the first org.
4543
IncludeProvisionerDaemon: true,
4644
},

enterprise/cli/organization_test.go

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,7 @@ func TestEditOrganizationRoles(t *testing.T) {
2525
t.Run("JSON", func(t *testing.T) {
2626
t.Parallel()
2727

28-
dv := coderdtest.DeploymentValues(t)
29-
dv.Experiments = []string{string(codersdk.ExperimentCustomRoles)}
3028
client, owner := coderdenttest.New(t, &coderdenttest.Options{
31-
Options: &coderdtest.Options{
32-
DeploymentValues: dv,
33-
},
3429
LicenseOptions: &coderdenttest.LicenseOptions{
3530
Features: license.Features{
3631
codersdk.FeatureCustomRoles: 1,
@@ -68,12 +63,7 @@ func TestEditOrganizationRoles(t *testing.T) {
6863
t.Run("InvalidRole", func(t *testing.T) {
6964
t.Parallel()
7065

71-
dv := coderdtest.DeploymentValues(t)
72-
dv.Experiments = []string{string(codersdk.ExperimentCustomRoles)}
7366
client, owner := coderdenttest.New(t, &coderdenttest.Options{
74-
Options: &coderdtest.Options{
75-
DeploymentValues: dv,
76-
},
7767
LicenseOptions: &coderdenttest.LicenseOptions{
7868
Features: license.Features{
7969
codersdk.FeatureCustomRoles: 1,
@@ -119,11 +109,9 @@ func TestShowOrganizations(t *testing.T) {
119109
t.Run("OnlyID", func(t *testing.T) {
120110
t.Parallel()
121111

122-
dv := coderdtest.DeploymentValues(t)
123112
ownerClient, first := coderdenttest.New(t, &coderdenttest.Options{
124113
Options: &coderdtest.Options{
125114
IncludeProvisionerDaemon: true,
126-
DeploymentValues: dv,
127115
},
128116
LicenseOptions: &coderdenttest.LicenseOptions{
129117
Features: license.Features{
@@ -158,11 +146,9 @@ func TestShowOrganizations(t *testing.T) {
158146

159147
t.Run("UsingFlag", func(t *testing.T) {
160148
t.Parallel()
161-
dv := coderdtest.DeploymentValues(t)
162149
ownerClient, first := coderdenttest.New(t, &coderdenttest.Options{
163150
Options: &coderdtest.Options{
164151
IncludeProvisionerDaemon: true,
165-
DeploymentValues: dv,
166152
},
167153
LicenseOptions: &coderdenttest.LicenseOptions{
168154
Features: license.Features{

enterprise/cli/organizationmembers_test.go

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,8 @@ func TestRemoveOrganizationMembers(t *testing.T) {
2020

2121
t.Run("OK", func(t *testing.T) {
2222
t.Parallel()
23-
dv := coderdtest.DeploymentValues(t)
2423

2524
ownerClient, _ := coderdenttest.New(t, &coderdenttest.Options{
26-
Options: &coderdtest.Options{
27-
DeploymentValues: dv,
28-
},
2925
LicenseOptions: &coderdenttest.LicenseOptions{
3026
Features: license.Features{
3127
codersdk.FeatureMultipleOrganizations: 1,
@@ -78,12 +74,7 @@ func TestEnterpriseListOrganizationMembers(t *testing.T) {
7874
t.Run("CustomRole", func(t *testing.T) {
7975
t.Parallel()
8076

81-
dv := coderdtest.DeploymentValues(t)
82-
dv.Experiments = []string{string(codersdk.ExperimentCustomRoles)}
8377
ownerClient, owner := coderdenttest.New(t, &coderdenttest.Options{
84-
Options: &coderdtest.Options{
85-
DeploymentValues: dv,
86-
},
8778
LicenseOptions: &coderdenttest.LicenseOptions{
8879
Features: license.Features{
8980
codersdk.FeatureCustomRoles: 1,
@@ -129,13 +120,7 @@ func TestAssignOrganizationMemberRole(t *testing.T) {
129120

130121
t.Run("OK", func(t *testing.T) {
131122
t.Parallel()
132-
dv := coderdtest.DeploymentValues(t)
133-
dv.Experiments = []string{string(codersdk.ExperimentCustomRoles)}
134-
135123
ownerClient, owner := coderdenttest.New(t, &coderdenttest.Options{
136-
Options: &coderdtest.Options{
137-
DeploymentValues: dv,
138-
},
139124
LicenseOptions: &coderdenttest.LicenseOptions{
140125
Features: license.Features{
141126
codersdk.FeatureCustomRoles: 1,

enterprise/cli/organizationsettings_test.go

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import (
1010
"github.com/stretchr/testify/require"
1111

1212
"github.com/coder/coder/v2/cli/clitest"
13-
"github.com/coder/coder/v2/coderd/coderdtest"
1413
"github.com/coder/coder/v2/coderd/rbac"
1514
"github.com/coder/coder/v2/codersdk"
1615
"github.com/coder/coder/v2/enterprise/coderd/coderdenttest"
@@ -24,12 +23,7 @@ func TestUpdateGroupSync(t *testing.T) {
2423
t.Run("OK", func(t *testing.T) {
2524
t.Parallel()
2625

27-
dv := coderdtest.DeploymentValues(t)
28-
2926
owner, first := coderdenttest.New(t, &coderdenttest.Options{
30-
Options: &coderdtest.Options{
31-
DeploymentValues: dv,
32-
},
3327
LicenseOptions: &coderdenttest.LicenseOptions{
3428
Features: license.Features{
3529
codersdk.FeatureMultipleOrganizations: 1,
@@ -80,12 +74,7 @@ func TestUpdateRoleSync(t *testing.T) {
8074
t.Run("OK", func(t *testing.T) {
8175
t.Parallel()
8276

83-
dv := coderdtest.DeploymentValues(t)
84-
8577
owner, _ := coderdenttest.New(t, &coderdenttest.Options{
86-
Options: &coderdtest.Options{
87-
DeploymentValues: dv,
88-
},
8978
LicenseOptions: &coderdenttest.LicenseOptions{
9079
Features: license.Features{
9180
codersdk.FeatureMultipleOrganizations: 1,
@@ -123,6 +112,4 @@ func TestUpdateRoleSync(t *testing.T) {
123112
inv.Stdout = buf
124113
err = inv.WithContext(ctx).Run()
125114
require.NoError(t, err)
126-
require.JSONEq(t, string(expectedData), buf.String())
127-
})
128-
}
115+
require.JSONE

enterprise/cli/provisionerdaemonstart_test.go

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,7 @@ func TestProvisionerDaemon_PSK(t *testing.T) {
3030
t.Run("OK", func(t *testing.T) {
3131
t.Parallel()
3232

33-
dv := coderdtest.DeploymentValues(t)
3433
client, _ := coderdenttest.New(t, &coderdenttest.Options{
35-
Options: &coderdtest.Options{
36-
DeploymentValues: dv,
37-
},
3834
ProvisionerDaemonPSK: "provisionersftw",
3935
LicenseOptions: &coderdenttest.LicenseOptions{
4036
Features: license.Features{
@@ -69,11 +65,7 @@ func TestProvisionerDaemon_PSK(t *testing.T) {
6965

7066
t.Run("AnotherOrgByNameWithUser", func(t *testing.T) {
7167
t.Parallel()
72-
dv := coderdtest.DeploymentValues(t)
7368
client, _ := coderdenttest.New(t, &coderdenttest.Options{
74-
Options: &coderdtest.Options{
75-
DeploymentValues: dv,
76-
},
7769
ProvisionerDaemonPSK: "provisionersftw",
7870
LicenseOptions: &coderdenttest.LicenseOptions{
7971
Features: license.Features{
@@ -222,11 +214,7 @@ func TestProvisionerDaemon_SessionToken(t *testing.T) {
222214

223215
t.Run("ScopeUserAnotherOrg", func(t *testing.T) {
224216
t.Parallel()
225-
dv := coderdtest.DeploymentValues(t)
226217
client, _ := coderdenttest.New(t, &coderdenttest.Options{
227-
Options: &coderdtest.Options{
228-
DeploymentValues: dv,
229-
},
230218
ProvisionerDaemonPSK: "provisionersftw",
231219
LicenseOptions: &coderdenttest.LicenseOptions{
232220
Features: license.Features{
@@ -270,7 +258,6 @@ func TestProvisionerDaemon_ProvisionerKey(t *testing.T) {
270258

271259
ctx, cancel := context.WithTimeout(context.Background(), testutil.WaitLong)
272260
defer cancel()
273-
dv := coderdtest.DeploymentValues(t)
274261
client, user := coderdenttest.New(t, &coderdenttest.Options{
275262
ProvisionerDaemonPSK: "provisionersftw",
276263
LicenseOptions: &coderdenttest.LicenseOptions{
@@ -279,9 +266,6 @@ func TestProvisionerDaemon_ProvisionerKey(t *testing.T) {
279266
codersdk.FeatureMultipleOrganizations: 1,
280267
},
281268
},
282-
Options: &coderdtest.Options{
283-
DeploymentValues: dv,
284-
},
285269
})
286270
// nolint:gocritic // test
287271
res, err := client.CreateProvisionerKey(ctx, user.OrganizationID, codersdk.CreateProvisionerKeyRequest{
@@ -315,7 +299,6 @@ func TestProvisionerDaemon_ProvisionerKey(t *testing.T) {
315299

316300
ctx, cancel := context.WithTimeout(context.Background(), testutil.WaitLong)
317301
defer cancel()
318-
dv := coderdtest.DeploymentValues(t)
319302
client, user := coderdenttest.New(t, &coderdenttest.Options{
320303
ProvisionerDaemonPSK: "provisionersftw",
321304
LicenseOptions: &coderdenttest.LicenseOptions{
@@ -324,9 +307,6 @@ func TestProvisionerDaemon_ProvisionerKey(t *testing.T) {
324307
codersdk.FeatureMultipleOrganizations: 1,
325308
},
326309
},
327-
Options: &coderdtest.Options{
328-
DeploymentValues: dv,
329-
},
330310
})
331311
// nolint:gocritic // test
332312
res, err := client.CreateProvisionerKey(ctx, user.OrganizationID, codersdk.CreateProvisionerKeyRequest{
@@ -345,7 +325,6 @@ func TestProvisionerDaemon_ProvisionerKey(t *testing.T) {
345325

346326
ctx, cancel := context.WithTimeout(context.Background(), testutil.WaitLong)
347327
defer cancel()
348-
dv := coderdtest.DeploymentValues(t)
349328
client, user := coderdenttest.New(t, &coderdenttest.Options{
350329
ProvisionerDaemonPSK: "provisionersftw",
351330
LicenseOptions: &coderdenttest.LicenseOptions{
@@ -354,9 +333,6 @@ func TestProvisionerDaemon_ProvisionerKey(t *testing.T) {
354333
codersdk.FeatureMultipleOrganizations: 1,
355334
},
356335
},
357-
Options: &coderdtest.Options{
358-
DeploymentValues: dv,
359-
},
360336
})
361337
// nolint:gocritic // test
362338
res, err := client.CreateProvisionerKey(ctx, user.OrganizationID, codersdk.CreateProvisionerKeyRequest{
@@ -375,7 +351,6 @@ func TestProvisionerDaemon_ProvisionerKey(t *testing.T) {
375351

376352
ctx, cancel := context.WithTimeout(context.Background(), testutil.WaitLong)
377353
defer cancel()
378-
dv := coderdtest.DeploymentValues(t)
379354
client, _ := coderdenttest.New(t, &coderdenttest.Options{
380355
ProvisionerDaemonPSK: "provisionersftw",
381356
LicenseOptions: &coderdenttest.LicenseOptions{
@@ -384,9 +359,6 @@ func TestProvisionerDaemon_ProvisionerKey(t *testing.T) {
384359
codersdk.FeatureMultipleOrganizations: 1,
385360
},
386361
},
387-
Options: &coderdtest.Options{
388-
DeploymentValues: dv,
389-
},
390362
})
391363
anotherOrg := coderdenttest.CreateOrganization(t, client, coderdenttest.CreateOrganizationOptions{})
392364
// nolint:gocritic // test

enterprise/cli/provisionerkeys_test.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,7 @@ func TestProvisionerKeys(t *testing.T) {
2323
t.Run("CRUD", func(t *testing.T) {
2424
t.Parallel()
2525

26-
dv := coderdtest.DeploymentValues(t)
2726
client, owner := coderdenttest.New(t, &coderdenttest.Options{
28-
Options: &coderdtest.Options{
29-
DeploymentValues: dv,
30-
},
3127
LicenseOptions: &coderdenttest.LicenseOptions{
3228
Features: license.Features{
3329
codersdk.FeatureMultipleOrganizations: 1,

enterprise/cli/templatecreate_test.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,10 +139,8 @@ func TestTemplateCreate(t *testing.T) {
139139
t.Run("SecondOrganization", func(t *testing.T) {
140140
t.Parallel()
141141

142-
dv := coderdtest.DeploymentValues(t)
143142
ownerClient, _ := coderdenttest.New(t, &coderdenttest.Options{
144143
Options: &coderdtest.Options{
145-
DeploymentValues: dv,
146144
// This only affects the first org.
147145
IncludeProvisionerDaemon: false,
148146
},

enterprise/cli/templatelist_test.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,9 @@ func TestEnterpriseListTemplates(t *testing.T) {
2323
t.Run("MultiOrg", func(t *testing.T) {
2424
t.Parallel()
2525

26-
dv := coderdtest.DeploymentValues(t)
2726
client, owner := coderdenttest.New(t, &coderdenttest.Options{
2827
Options: &coderdtest.Options{
2928
IncludeProvisionerDaemon: true,
30-
DeploymentValues: dv,
3129
},
3230
LicenseOptions: &coderdenttest.LicenseOptions{
3331
Features: license.Features{

enterprise/coderd/audit_test.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import (
77
"github.com/google/uuid"
88
"github.com/stretchr/testify/require"
99

10-
"github.com/coder/coder/v2/coderd/coderdtest"
1110
"github.com/coder/coder/v2/codersdk"
1211
"github.com/coder/coder/v2/enterprise/coderd/coderdenttest"
1312
"github.com/coder/coder/v2/enterprise/coderd/license"
@@ -20,11 +19,7 @@ func TestEnterpriseAuditLogs(t *testing.T) {
2019
t.Parallel()
2120

2221
ctx := context.Background()
23-
dv := coderdtest.DeploymentValues(t)
2422
client, user := coderdenttest.New(t, &coderdenttest.Options{
25-
Options: &coderdtest.Options{
26-
DeploymentValues: dv,
27-
},
2823
LicenseOptions: &coderdenttest.LicenseOptions{
2924
Features: license.Features{
3025
codersdk.FeatureMultipleOrganizations: 1,

enterprise/coderd/coderd.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,6 @@ func New(ctx context.Context, options *Options) (_ *API, err error) {
279279
r.Use(
280280
apiKeyMiddleware,
281281
api.RequireFeatureMW(codersdk.FeatureCustomRoles),
282-
httpmw.RequireExperiment(api.AGPL.Experiments, codersdk.ExperimentCustomRoles),
283282
httpmw.ExtractOrganizationParam(api.Database),
284283
)
285284
r.Post("/organizations/{organization}/members/roles", api.postOrgRoles)

enterprise/coderd/idpsync_test.go

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,7 @@ func TestGetGroupSyncConfig(t *testing.T) {
2525
t.Run("OK", func(t *testing.T) {
2626
t.Parallel()
2727

28-
dv := coderdtest.DeploymentValues(t)
29-
3028
owner, db, user := coderdenttest.NewWithDatabase(t, &coderdenttest.Options{
31-
Options: &coderdtest.Options{
32-
DeploymentValues: dv,
33-
},
3429
LicenseOptions: &coderdenttest.LicenseOptions{
3530
Features: license.Features{
3631
codersdk.FeatureCustomRoles: 1,
@@ -93,11 +88,7 @@ func TestPostGroupSyncConfig(t *testing.T) {
9388
t.Run("OK", func(t *testing.T) {
9489
t.Parallel()
9590

96-
dv := coderdtest.DeploymentValues(t)
9791
owner, user := coderdenttest.New(t, &coderdenttest.Options{
98-
Options: &coderdtest.Options{
99-
DeploymentValues: dv,
100-
},
10192
LicenseOptions: &coderdenttest.LicenseOptions{
10293
Features: license.Features{
10394
codersdk.FeatureCustomRoles: 1,
@@ -124,11 +115,7 @@ func TestPostGroupSyncConfig(t *testing.T) {
124115
t.Run("NotAuthorized", func(t *testing.T) {
125116
t.Parallel()
126117

127-
dv := coderdtest.DeploymentValues(t)
128118
owner, user := coderdenttest.New(t, &coderdenttest.Options{
129-
Options: &coderdtest.Options{
130-
DeploymentValues: dv,
131-
},
132119
LicenseOptions: &coderdenttest.LicenseOptions{
133120
Features: license.Features{
134121
codersdk.FeatureCustomRoles: 1,
@@ -159,11 +146,7 @@ func TestGetRoleSyncConfig(t *testing.T) {
159146
t.Run("OK", func(t *testing.T) {
160147
t.Parallel()
161148

162-
dv := coderdtest.DeploymentValues(t)
163149
owner, _, _, user := coderdenttest.NewWithAPI(t, &coderdenttest.Options{
164-
Options: &coderdtest.Options{
165-
DeploymentValues: dv,
166-
},
167150
LicenseOptions: &coderdenttest.LicenseOptions{
168151
Features: license.Features{
169152
codersdk.FeatureCustomRoles: 1,
@@ -197,11 +180,7 @@ func TestPostRoleSyncConfig(t *testing.T) {
197180
t.Run("OK", func(t *testing.T) {
198181
t.Parallel()
199182

200-
dv := coderdtest.DeploymentValues(t)
201183
owner, user := coderdenttest.New(t, &coderdenttest.Options{
202-
Options: &coderdtest.Options{
203-
DeploymentValues: dv,
204-
},
205184
LicenseOptions: &coderdenttest.LicenseOptions{
206185
Features: license.Features{
207186
codersdk.FeatureCustomRoles: 1,
@@ -228,11 +207,7 @@ func TestPostRoleSyncConfig(t *testing.T) {
228207
t.Run("NotAuthorized", func(t *testing.T) {
229208
t.Parallel()
230209

231-
dv := coderdtest.DeploymentValues(t)
232210
owner, user := coderdenttest.New(t, &coderdenttest.Options{
233-
Options: &coderdtest.Options{
234-
DeploymentValues: dv,
235-
},
236211
LicenseOptions: &coderdenttest.LicenseOptions{
237212
Features: license.Features{
238213
codersdk.FeatureCustomRoles: 1,

0 commit comments

Comments
 (0)