Skip to content

Commit 09ac2ba

Browse files
committed
Fix gpg key test
1 parent 9ea18e4 commit 09ac2ba

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed

cli/ssh.go

+6-3
Original file line numberDiff line numberDiff line change
@@ -433,9 +433,10 @@ func runRemoteSSH(sshClient *gossh.Client, stdin io.Reader, cmd string) ([]byte,
433433

434434
stderr := bytes.NewBuffer(nil)
435435
sess.Stdin = stdin
436-
sess.Stderr = stderr
437-
438-
out, err := sess.Output(cmd)
436+
// On fish, this was outputting to stderr instead of stdout.
437+
// The tests pass differently on different Linux machines,
438+
// so it's best we capture the output of both.
439+
out, err := sess.CombinedOutput(cmd)
439440
if err != nil {
440441
return out, xerrors.Errorf(
441442
"`%s` failed: stderr: %s\n\nstdout: %s:\n\n%w",
@@ -470,6 +471,8 @@ fi
470471
471472
test ! -S "$agent_socket"
472473
`)
474+
fmt.Printf("Agent bytes %s\n", agentSocketBytes)
475+
473476
agentSocket := strings.TrimSpace(string(agentSocketBytes))
474477
if err != nil {
475478
return xerrors.Errorf("check if agent socket is running (check if %q exists): %w", agentSocket, err)

cli/testdata/coder_templates_create_--help.golden

+2-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ Flags:
77
--default-ttl duration Specify a default TTL for workspaces created from this
88
template. (default 24h0m0s)
99
-d, --directory string Specify the directory to create from, use '-' to read
10-
tar from stdin (default "/tmp/coder-cli-test-workdir")
10+
tar from stdin (default
11+
"/tmp/coder-cli-test-workdir")
1112
-h, --help help for create
1213
--parameter-file string Specify a file path with parameter values.
1314
--provisioner-tag stringArray Specify a set of tags to target provisioner daemons.

cli/testdata/coder_templates_push_--help.golden

+2-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ Flags:
77
--always-prompt Always prompt all parameters. Does not pull parameter
88
values from active template version
99
-d, --directory string Specify the directory to create from, use '-' to read
10-
tar from stdin (default "/tmp/coder-cli-test-workdir")
10+
tar from stdin (default
11+
"/tmp/coder-cli-test-workdir")
1112
-h, --help help for push
1213
--name string Specify a name for the new template version. It will be
1314
automatically generated if not provided.

0 commit comments

Comments
 (0)