Skip to content

Commit 96124b6

Browse files
committed
simplify
1 parent c3da45c commit 96124b6

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

e2e/echo_test.go

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -88,12 +88,8 @@ func TestE2E(t *testing.T) {
8888

8989
script, apiClient := setup(ctx, t, &params{
9090
cmdFn: func(ctx context.Context, t testing.TB, serverPort int, binaryPath, cwd, scriptFilePath string) (string, []string) {
91-
script := fmt.Sprintf(`echo "hello agent" | %s server --port=%d -- go run %s %s`,
92-
binaryPath,
93-
serverPort,
94-
filepath.Join(cwd, "echo.go"),
95-
scriptFilePath,
96-
)
91+
defCmd, defArgs := defaultCmdFn(ctx, t, serverPort, binaryPath, cwd, scriptFilePath)
92+
script := fmt.Sprintf(`echo "hello agent" | %s %s`, defCmd, strings.Join(defArgs, " "))
9793
return "/bin/sh", []string{"-c", script}
9894
},
9995
})
@@ -154,6 +150,7 @@ func setup(ctx context.Context, t testing.TB, p *params) ([]ScriptEntry, *agenta
154150
require.NoError(t, err, "Failed to get current working directory")
155151

156152
bin, args := p.cmdFn(ctx, t, serverPort, binaryPath, cwd, scriptFilePath)
153+
t.Logf("Running command: %s %s", bin, strings.Join(args, " "))
157154
cmd := exec.CommandContext(ctx, bin, args...)
158155

159156
// Capture output for debugging

0 commit comments

Comments
 (0)