fix(go): select the host CLI package in E2E tests - #2163
Conversation
|
Revalidated this PR against current The existing PR patch applies cleanly on current
Both full E2E runs rewrite replay snapshots as part of the harness; those generated changes were restored after each run, and the final source worktree is clean. I also attempted an exact |
SteveSandersonMS
left a comment
There was a problem hiding this comment.
I independently reproduced the platform-selection bug and validated the fix. The change is confined to Go E2E discovery and is safe to merge.
|
/test |
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Resolve merge conflicts while preserving current runtime preparation and Go E2E coverage. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Closes #2116.
What this changes
The Go E2E harness now derives exact
@github/copilot-<platform>-<arch>package candidates from
ffihost.PrebuildsFolder()instead of globbing everycopilot-*directory and taking the first sorted result.variant second;
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.shapplies the same exact host OS/architecture mapping.The shared
.github/actions/setup-copilotaction is intentionally unchanged,as called out in the Issue.
Tests
Added unit coverage for:
index.js; andLocal validation:
GOTOOLCHAIN=go1.24.0 go test ./internal/e2e/testharnessgo test ./...env -u COPILOT_CLI_PATH bash test.shCOPILOT_SDK_DEFAULT_CONNECTION=inprocess GOFLAGS=-tags=copilot_inprocess env -u COPILOT_CLI_PATH bash test.shgolangci-lint run ./... --timeout=5m(0 issues)bash -n go/test.shand arm64
Both the default and in-process full race-enabled test runs passed.