Skip to content

Commit 39dde8b

Browse files
committed
address linter complaints in features_test and licenses_test
1 parent 0ba04bb commit 39dde8b

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

enterprise/cli/features_test.go

+7-4
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import (
99
"github.com/stretchr/testify/require"
1010

1111
"github.com/coder/coder/v2/cli/clitest"
12+
"github.com/coder/coder/v2/coderd/coderdtest"
1213
"github.com/coder/coder/v2/codersdk"
1314
"github.com/coder/coder/v2/enterprise/coderd/coderdenttest"
1415
"github.com/coder/coder/v2/pty/ptytest"
@@ -18,9 +19,10 @@ func TestFeaturesList(t *testing.T) {
1819
t.Parallel()
1920
t.Run("Table", func(t *testing.T) {
2021
t.Parallel()
21-
client, _ := coderdenttest.New(t, &coderdenttest.Options{DontAddLicense: true})
22+
client, admin := coderdenttest.New(t, &coderdenttest.Options{DontAddLicense: true})
23+
anotherClient, _ := coderdtest.CreateAnotherUser(t, client, admin.OrganizationID)
2224
inv, conf := newCLI(t, "features", "list")
23-
clitest.SetupConfig(t, client, conf)
25+
clitest.SetupConfig(t, anotherClient, conf)
2426
pty := ptytest.New(t).Attach(inv)
2527
clitest.Start(t, inv)
2628
pty.ExpectMatch("user_limit")
@@ -29,9 +31,10 @@ func TestFeaturesList(t *testing.T) {
2931
t.Run("JSON", func(t *testing.T) {
3032
t.Parallel()
3133

32-
client, _ := coderdenttest.New(t, &coderdenttest.Options{DontAddLicense: true})
34+
client, admin := coderdenttest.New(t, &coderdenttest.Options{DontAddLicense: true})
35+
anotherClient, _ := coderdtest.CreateAnotherUser(t, client, admin.OrganizationID)
3336
inv, conf := newCLI(t, "features", "list", "-o", "json")
34-
clitest.SetupConfig(t, client, conf)
37+
clitest.SetupConfig(t, anotherClient, conf)
3538
doneChan := make(chan struct{})
3639

3740
buf := bytes.NewBuffer(nil)

enterprise/cli/licenses_test.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ func TestLicensesAddReal(t *testing.T) {
122122
t,
123123
"licenses", "add", "-l", fakeLicenseJWT,
124124
)
125-
clitest.SetupConfig(t, client, conf)
125+
clitest.SetupConfig(t, client, conf) //nolint:gocritic // requires owner
126126

127127
waiter := clitest.StartWithWaiter(t, inv)
128128
var coderError *codersdk.Error
@@ -180,7 +180,7 @@ func TestLicensesListReal(t *testing.T) {
180180
inv.Stdout = stdout
181181
stderr := new(bytes.Buffer)
182182
inv.Stderr = stderr
183-
clitest.SetupConfig(t, client, conf)
183+
clitest.SetupConfig(t, client, conf) //nolint:gocritic // requires owner
184184
ctx, cancel := context.WithTimeout(context.Background(), testutil.WaitLong)
185185
defer cancel()
186186
errC := make(chan error)
@@ -216,7 +216,7 @@ func TestLicensesDeleteReal(t *testing.T) {
216216
inv, conf := newCLI(
217217
t,
218218
"licenses", "delete", "1")
219-
clitest.SetupConfig(t, client, conf)
219+
clitest.SetupConfig(t, client, conf) //nolint:gocritic // requires owner
220220

221221
var coderError *codersdk.Error
222222
clitest.StartWithWaiter(t, inv).RequireAs(&coderError)

0 commit comments

Comments
 (0)