Skip to content

Commit be62f41

Browse files
committed
fix: update tests to add fish support
1 parent ea7e55f commit be62f41

File tree

4 files changed

+10
-6
lines changed

4 files changed

+10
-6
lines changed

agent/agent.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -268,10 +268,10 @@ func (a *agent) run(ctx context.Context) error {
268268

269269
scriptDone := make(chan error, 1)
270270
scriptStart := time.Now()
271-
go func() {
271+
err = a.trackConnGoroutine(func() {
272272
defer close(scriptDone)
273273
scriptDone <- a.runStartupScript(ctx, metadata.StartupScript)
274-
}()
274+
})
275275
go func() {
276276
var timeout <-chan time.Time
277277
// If timeout is zero, an older version of the coder

agent/agent_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -703,7 +703,7 @@ func TestAgent_Lifecycle(t *testing.T) {
703703
t.Parallel()
704704

705705
_, client, _, _ := setupAgent(t, agentsdk.Metadata{
706-
StartupScript: "sleep 10",
706+
StartupScript: "sleep 5",
707707
StartupScriptTimeout: time.Nanosecond,
708708
}, 0)
709709

cli/root_test.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ import (
2424
"github.com/coder/coder/testutil"
2525
)
2626

27+
func init() {
28+
// os.Setenv("NO_COLOR", "1")
29+
}
30+
2731
// To update the golden files:
2832
// make update-golden-files
2933
var updateGoldenFiles = flag.Bool("update", false, "update .golden files")
@@ -112,7 +116,7 @@ ExtractCommandPathsLoop:
112116

113117
got := buf.Bytes()
114118
// Remove CRLF newlines (Windows).
115-
got = bytes.ReplaceAll(got, []byte{'\r', '\n'}, []byte{'\n'})
119+
// got = bytes.ReplaceAll(got, []byte{'\r', '\n'}, []byte{'\n'})
116120

117121
// The `coder templates create --help` command prints the path
118122
// to the working directory (--directory flag default value).

cli/ssh.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -458,7 +458,7 @@ func uploadGPGKeys(ctx context.Context, sshClient *gossh.Client) error {
458458
//
459459
// Note: we sleep after killing the agent because it doesn't always die
460460
// immediately.
461-
agentSocketBytes, err := runRemoteSSH(sshClient, nil, `
461+
agentSocketBytes, err := runRemoteSSH(sshClient, nil, `sh -c '
462462
set -eux
463463
agent_socket=$(gpgconf --list-dir agent-socket)
464464
echo "$agent_socket"
@@ -470,7 +470,7 @@ if [ -S "$agent_socket" ]; then
470470
fi
471471
472472
test ! -S "$agent_socket"
473-
`)
473+
'`)
474474
agentSocket := strings.TrimSpace(string(agentSocketBytes))
475475
if err != nil {
476476
return xerrors.Errorf("check if agent socket is running (check if %q exists): %w", agentSocket, err)

0 commit comments

Comments
 (0)