Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix TestMultiClient
  • Loading branch information
qmuntal committed Mar 23, 2026
commit f89269922c8526b76b41bd9a8d32e9e742f35a43
7 changes: 2 additions & 5 deletions go/internal/e2e/multi_client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,8 @@ import (
func TestMultiClient(t *testing.T) {
// Use TCP mode so a second client can connect to the same CLI process
ctx := testharness.NewTestContext(t)
client1 := copilot.NewClient(&copilot.ClientOptions{
CLIPath: ctx.CLIPath,
Cwd: ctx.WorkDir,
Env: ctx.Env(),
UseStdio: copilot.Bool(false),
client1 := ctx.NewClient(func(opts *copilot.ClientOptions) {
opts.UseStdio = copilot.Bool(false)
})
t.Cleanup(func() { client1.ForceStop() })

Expand Down
7 changes: 6 additions & 1 deletion go/internal/e2e/testharness/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,8 @@ func (c *TestContext) Env() []string {
}

// NewClient creates a CopilotClient configured for this test context.
func (c *TestContext) NewClient() *copilot.Client {
// Optional overrides can be applied to the default ClientOptions via the opts function.
func (c *TestContext) NewClient(opts ...func(*copilot.ClientOptions)) *copilot.Client {
options := &copilot.ClientOptions{
CLIPath: c.CLIPath,
Cwd: c.WorkDir,
Expand All @@ -170,6 +171,10 @@ func (c *TestContext) NewClient() *copilot.Client {
options.GitHubToken = "fake-token-for-e2e-tests"
}

for _, opt := range opts {
opt(options)
}

return copilot.NewClient(options)
}

Expand Down
Loading