Skip to content

Commit c1b2304

Browse files
test(agent/agentssh): use fish shell compatible exit status checking (#18824)
This (week-old) test was failing in my workspace because I use fish shell. I really do not like that Fish shell does not support `$?`, but I also do like Fish shell! We have a few people at Coder who use it who would appreciate this change.
1 parent b882d46 commit c1b2304

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

agent/agentssh/agentssh_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,7 @@ func TestSSHServer_ClosesStdin(t *testing.T) {
453453
// exit code 1 if it hits EOF, which is what we want to test.
454454
cmdErrCh := make(chan error, 1)
455455
go func() {
456-
cmdErrCh <- sess.Start(fmt.Sprintf("echo started; read; echo \"read exit code: $?\" > %s", filePath))
456+
cmdErrCh <- sess.Start(fmt.Sprintf(`echo started; echo "read exit code: $(read && echo 0 || echo 1)" > %s`, filePath))
457457
}()
458458

459459
cmdErr := testutil.RequireReceive(ctx, t, cmdErrCh)

0 commit comments

Comments
 (0)