Skip to content
This repository has been archived by the owner on Aug 30, 2024. It is now read-only.

Commit

Permalink
internal/cmd/users_test.go: assert CICD user instead of admin
Browse files Browse the repository at this point in the history
  • Loading branch information
johnstcn committed Aug 17, 2021
1 parent eefa2f3 commit 0e63d2f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
4 changes: 1 addition & 3 deletions internal/cmd/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,11 +180,9 @@ func (u *updater) Run(ctx context.Context, force bool, coderURLArg string, versi

// TODO: validate the checksum of the downloaded file. GitHub does not currently provide this information
// and we do not generate them yet.
var updatedBinaryName string
updatedBinaryName := "coder"
if u.osF() == "windows" {
updatedBinaryName = "coder.exe"
} else {
updatedBinaryName = "coder"
}
updatedBinary, err := extractFromArchive(updatedBinaryName, downloadBuf.Bytes())
if err != nil {
Expand Down
8 changes: 4 additions & 4 deletions internal/cmd/users_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,17 @@ func Test_users(t *testing.T) {
res := execute(t, nil, "users", "ls", "--output=json")
res.success(t)
res.stdoutUnmarshals(t, &users)
assertAdmin(t, users)
assertCICD(t, users)

res = execute(t, nil, "users", "ls", "--output=human")
res.success(t)
}

func assertAdmin(t *testing.T, users []coder.User) {
func assertCICD(t *testing.T, users []coder.User) {
for _, u := range users {
if u.Username == "admin" {
if u.Username == "cicd" {
return
}
}
slogtest.Fatal(t, "did not find admin user", slog.F("users", users))
slogtest.Fatal(t, "did not find cicd user", slog.F("users", users))
}

0 comments on commit 0e63d2f

Please sign in to comment.