Skip to content

chore(cli): add linter to detect potential spurious usage of owner user in cli tests #10133

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 24 commits into from
Oct 10, 2023
Merged
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
d3114cd
chore: add linter to detect potential spurious usage of owner user in…
johnstcn Oct 7, 2023
e037fae
fix new linter complaints in userstatus_test.go
johnstcn Oct 9, 2023
b2da229
fix new linter complaints in userlist_test.go
johnstcn Oct 9, 2023
b0cedf6
fix new linter complaints in templatepush_test.go and update_test.go
johnstcn Oct 9, 2023
d4d53b5
fix new linter complaints in templatepush_test.go
johnstcn Oct 9, 2023
23a2658
address new linter complaints in templatepull_test.go
johnstcn Oct 9, 2023
4ef3b4e
fixup! chore: add linter to detect potential spurious usage of owner …
johnstcn Oct 9, 2023
709a7b7
fix new linter complaints in templatelist_test.go
johnstcn Oct 9, 2023
d6ca45d
fix new linter complaints in templateedit_test.go
johnstcn Oct 9, 2023
178d08b
fix new linter complaints in templatedelete_test.go
johnstcn Oct 9, 2023
c6f14f5
fix new linter complaints in state_test.go
johnstcn Oct 9, 2023
e281d9b
fix new linter complaints in start-test.go
johnstcn Oct 9, 2023
044edc7
fix new linter complaints in show_test.go
johnstcn Oct 9, 2023
21e1c5b
fix new linter complaints in restart_test.go
johnstcn Oct 9, 2023
a1f8fc4
fix new linter complaints in rename_test.go
johnstcn Oct 9, 2023
bfbbe66
fix new linter complaints in list_test.go
johnstcn Oct 9, 2023
92e6886
fix new linter complaints in delete_test.go, update docs
johnstcn Oct 9, 2023
7ce5bf4
fix new linter complaints in create_test.go
johnstcn Oct 9, 2023
c0fa0a4
fix new linter complaints in configssh__test.go
johnstcn Oct 9, 2023
0792d99
fix new linter complaints in agent_test.go
johnstcn Oct 9, 2023
9ef0f3c
fix issues in portforward_test that the linter missed :(
johnstcn Oct 10, 2023
277ffe8
consistently name result of CreateFirstUser owner instead of admin
johnstcn Oct 10, 2023
e43d307
Merge remote-tracking branch 'origin/main' into cj/owner-user-linter
johnstcn Oct 10, 2023
23a555a
address new linter complaints in user_delete_test.go
johnstcn Oct 10, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix new linter complaints in list_test.go
  • Loading branch information
johnstcn committed Oct 9, 2023
commit bfbbe66d280be774f2fe30b9c34412b97ca5a995
22 changes: 12 additions & 10 deletions cli/list_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,15 @@ func TestList(t *testing.T) {
t.Run("Single", func(t *testing.T) {
t.Parallel()
client := coderdtest.New(t, &coderdtest.Options{IncludeProvisionerDaemon: true})
user := coderdtest.CreateFirstUser(t, client)
version := coderdtest.CreateTemplateVersion(t, client, user.OrganizationID, nil)
admin := coderdtest.CreateFirstUser(t, client)
member, _ := coderdtest.CreateAnotherUser(t, client, admin.OrganizationID)
version := coderdtest.CreateTemplateVersion(t, client, admin.OrganizationID, nil)
coderdtest.AwaitTemplateVersionJobCompleted(t, client, version.ID)
template := coderdtest.CreateTemplate(t, client, user.OrganizationID, version.ID)
workspace := coderdtest.CreateWorkspace(t, client, user.OrganizationID, template.ID)
template := coderdtest.CreateTemplate(t, client, admin.OrganizationID, version.ID)
workspace := coderdtest.CreateWorkspace(t, member, admin.OrganizationID, template.ID)
coderdtest.AwaitWorkspaceBuildJobCompleted(t, client, workspace.LatestBuild.ID)
inv, root := clitest.New(t, "ls")
clitest.SetupConfig(t, client, root)
clitest.SetupConfig(t, member, root)
pty := ptytest.New(t).Attach(inv)

ctx, cancelFunc := context.WithTimeout(context.Background(), testutil.WaitLong)
Expand All @@ -48,15 +49,16 @@ func TestList(t *testing.T) {
t.Run("JSON", func(t *testing.T) {
t.Parallel()
client := coderdtest.New(t, &coderdtest.Options{IncludeProvisionerDaemon: true})
user := coderdtest.CreateFirstUser(t, client)
version := coderdtest.CreateTemplateVersion(t, client, user.OrganizationID, nil)
admin := coderdtest.CreateFirstUser(t, client)
member, _ := coderdtest.CreateAnotherUser(t, client, admin.OrganizationID)
version := coderdtest.CreateTemplateVersion(t, client, admin.OrganizationID, nil)
coderdtest.AwaitTemplateVersionJobCompleted(t, client, version.ID)
template := coderdtest.CreateTemplate(t, client, user.OrganizationID, version.ID)
workspace := coderdtest.CreateWorkspace(t, client, user.OrganizationID, template.ID)
template := coderdtest.CreateTemplate(t, client, admin.OrganizationID, version.ID)
workspace := coderdtest.CreateWorkspace(t, member, admin.OrganizationID, template.ID)
coderdtest.AwaitWorkspaceBuildJobCompleted(t, client, workspace.LatestBuild.ID)

inv, root := clitest.New(t, "list", "--output=json")
clitest.SetupConfig(t, client, root)
clitest.SetupConfig(t, member, root)

ctx, cancelFunc := context.WithTimeout(context.Background(), testutil.WaitLong)
defer cancelFunc()
Expand Down