Skip to content

fix(go): select the host CLI package in E2E tests - #2163

Draft
Pybsama wants to merge 1 commit into
github:mainfrom
Pybsama:codex/fix-go-cli-platform-selection
Draft

fix(go): select the host CLI package in E2E tests#2163
Pybsama wants to merge 1 commit into
github:mainfrom
Pybsama:codex/fix-go-cli-platform-selection

Conversation

@Pybsama

@Pybsama Pybsama commented Jul 30, 2026

Copy link
Copy Markdown

Closes #2116.

What this changes

The Go E2E harness now derives exact @github/copilot-<platform>-<arch>
package candidates from ffihost.PrebuildsFolder() instead of globbing every
copilot-* directory and taking the first sorted result.

  • macOS and Windows probe only their exact host package;
  • Linux probes the detected glibc/musl package first and the sibling libc
    variant second;
  • unrelated or foreign-platform copilot-* packages are ignored;
  • CLIPath(testing.TB) reports the packages tried and those actually present,
    replacing the duplicated empty-path guards at its call sites; and
  • go/test.sh applies the same exact host OS/architecture mapping.

The shared .github/actions/setup-copilot action is intentionally unchanged,
as called out in the Issue.

Tests

Added unit coverage for:

  • macOS, Windows, Linux glibc, and Linux musl candidate generation;
  • ignoring alphabetically earlier foreign and non-platform packages;
  • respecting Linux libc candidate order;
  • rejecting a package without an index.js; and
  • listing installed packages for failure diagnostics.

Local validation:

  • GOTOOLCHAIN=go1.24.0 go test ./internal/e2e/testharness
  • go test ./...
  • env -u COPILOT_CLI_PATH bash test.sh
  • COPILOT_SDK_DEFAULT_CONNECTION=inprocess GOFLAGS=-tags=copilot_inprocess env -u COPILOT_CLI_PATH bash test.sh
  • golangci-lint run ./... --timeout=5m (0 issues)
  • bash -n go/test.sh
  • cross-compiled the testharness tests for Linux, Windows, and macOS on amd64
    and arm64

Both the default and in-process full race-enabled test runs passed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Go][tests] E2E harness picks the first @github/copilot-* package instead of the current platform package

1 participant