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

Commit 0e63d2f

Browse files
committed
internal/cmd/users_test.go: assert CICD user instead of admin
1 parent eefa2f3 commit 0e63d2f

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

internal/cmd/update.go

+1-3
Original file line numberDiff line numberDiff line change
@@ -180,11 +180,9 @@ func (u *updater) Run(ctx context.Context, force bool, coderURLArg string, versi
180180

181181
// TODO: validate the checksum of the downloaded file. GitHub does not currently provide this information
182182
// and we do not generate them yet.
183-
var updatedBinaryName string
183+
updatedBinaryName := "coder"
184184
if u.osF() == "windows" {
185185
updatedBinaryName = "coder.exe"
186-
} else {
187-
updatedBinaryName = "coder"
188186
}
189187
updatedBinary, err := extractFromArchive(updatedBinaryName, downloadBuf.Bytes())
190188
if err != nil {

internal/cmd/users_test.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,17 @@ func Test_users(t *testing.T) {
1616
res := execute(t, nil, "users", "ls", "--output=json")
1717
res.success(t)
1818
res.stdoutUnmarshals(t, &users)
19-
assertAdmin(t, users)
19+
assertCICD(t, users)
2020

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

25-
func assertAdmin(t *testing.T, users []coder.User) {
25+
func assertCICD(t *testing.T, users []coder.User) {
2626
for _, u := range users {
27-
if u.Username == "admin" {
27+
if u.Username == "cicd" {
2828
return
2929
}
3030
}
31-
slogtest.Fatal(t, "did not find admin user", slog.F("users", users))
31+
slogtest.Fatal(t, "did not find cicd user", slog.F("users", users))
3232
}

0 commit comments

Comments
 (0)