Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Aug 30, 2024. It is now read-only.
/coder-v1-cliPublic archive

Commitd244d35

Browse files
authored
Allow integration tests to pass on fresh deployments (#131)
1 parentbf9a6ae commitd244d35

File tree

2 files changed

+21
-6
lines changed

2 files changed

+21
-6
lines changed

‎ci/integration/ssh_test.go

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,29 @@ import (
55
"testing"
66

77
"cdr.dev/coder-cli/ci/tcli"
8+
"cdr.dev/coder-cli/coder-sdk"
89
)
910

1011
funcTestSSH(t*testing.T) {
1112
t.Parallel()
1213
run(t,"ssh-coder-cli-tests",func(t*testing.T,ctx context.Context,c*tcli.ContainerRunner) {
1314
headlessLogin(ctx,t,c)
14-
c.Run(ctx,"coder config-ssh").Assert(t,
15+
16+
// TODO remove this once we can create an environment if there aren't any
17+
varenvs []coder.Environment
18+
c.Run(ctx,"coder envs ls --output json").Assert(t,
1519
tcli.Success(),
20+
tcli.StdoutJSONUnmarshal(&envs),
21+
)
22+
23+
assert:=tcli.Success()
24+
25+
// if we don't have any environments, "coder config-ssh" will fail
26+
iflen(envs)==0 {
27+
assert=tcli.Error()
28+
}
29+
c.Run(ctx,"coder config-ssh").Assert(t,
30+
assert,
1631
)
1732
})
1833
}

‎ci/integration/users_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,16 @@ func TestUsers(t *testing.T) {
2121
headlessLogin(ctx,t,c)
2222

2323
varuser coder.User
24-
c.Run(ctx,`coder users ls --output json | jq -c '.[] | select( .username == "charlie")'`).Assert(t,
24+
c.Run(ctx,`coder users ls --output json | jq -c '.[] | select( .username == "admin")'`).Assert(t,
2525
tcli.Success(),
2626
tcli.StdoutJSONUnmarshal(&user),
2727
)
28-
assert.Equal(t,"user email is as expected","charlie@coder.com",user.Email)
29-
assert.Equal(t,"username is as expected","Charlie",user.Name)
28+
assert.Equal(t,"user email is as expected","admin",user.Email)
29+
assert.Equal(t,"name is as expected","admin",user.Name)
3030

31-
c.Run(ctx,"coder users ls --output human | grepcharlie").Assert(t,
31+
c.Run(ctx,"coder users ls --output human | grepadmin").Assert(t,
3232
tcli.Success(),
33-
tcli.StdoutMatches("charlie"),
33+
tcli.StdoutMatches("admin"),
3434
)
3535

3636
c.Run(ctx,"coder logout").Assert(t,

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp