Skip to content

Commit fad0208

Browse files
authored
fix: avoid logging env in unit tests (#9885)
1 parent d8515f0 commit fad0208

File tree

3 files changed

+2
-3
lines changed

3 files changed

+2
-3
lines changed

cli/root.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,6 @@ func (r *RootCmd) Command(subcommands []*clibase.Cmd) (*clibase.Cmd, error) {
161161
},
162162
),
163163
Handler: func(i *clibase.Invocation) error {
164-
// fmt.Fprintf(i.Stderr, "env debug: %+v", i.Environ)
165164
// The GIT_ASKPASS environment variable must point at
166165
// a binary with no arguments. To prevent writing
167166
// cross-platform scripts to invoke the Coder binary

cli/ssh_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ func TestSSH(t *testing.T) {
368368
// Ensure that SSH_AUTH_SOCK is set.
369369
// Linux: /tmp/auth-agent3167016167/listener.sock
370370
// macOS: /var/folders/ng/m1q0wft14hj0t3rtjxrdnzsr0000gn/T/auth-agent3245553419/listener.sock
371-
pty.WriteLine("env")
371+
pty.WriteLine(`env | grep SSH_AUTH_SOCK=`)
372372
pty.ExpectMatch("SSH_AUTH_SOCK=")
373373
// Ensure that ssh-add lists our key.
374374
pty.WriteLine("ssh-add -L")

pty/start_other_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ func TestStart(t *testing.T) {
5454
Height: 24,
5555
},
5656
}))
57-
pty, ps := ptytest.Start(t, pty.Command("env"), opts)
57+
pty, ps := ptytest.Start(t, pty.Command(`/bin/sh`, `-c`, `env | grep SSH_TTY`), opts)
5858
pty.ExpectMatch("SSH_TTY=/dev/")
5959
err := ps.Wait()
6060
require.NoError(t, err)

0 commit comments

Comments
 (0)