Repository navigation
CI: run Windows pnpm e2e tests instead of skipping (#1054) - #1407
Conversation
Assisted-by: Claude Code:claude-opus-5-5
On windows-latest the pnpm-family e2e suites started pnpm and corepack with a bare Command::new, which only finds .exe files. npm and Node install both tools as .cmd shims there, so every availability probe said the tool was missing and every test skipped. libtest counts a skip as a pass, so the nightly Windows legs went green in 0.02 s while testing nothing. Add hermetic::tool_command, which resolves a tool through PATHEXT the same way the CLI does, and use it for every pnpm, corepack and npm spawn in e2e_safety_pnpm, e2e_redirect_pnpm_build and e2e_redirect_rush_sim, and in common::run_toolchain. Refs #1054 Assisted-by: Claude Code:claude-opus-5-5
Set pnpm_required on the Windows and macOS rows of e2e_safety_pnpm, e2e_redirect_pnpm_build and e2e_redirect_rush_sim. A missing pnpm or corepack now fails the leg instead of letting it pass with every test skipped. These rows only run in the full tier (nightly and dispatch), so PR and merge-queue runs are unchanged. The workflow contract test now checks the gate on every OS, and a new check stops these suites from spawning bare pnpm, corepack or npm again. Refs #1054 Assisted-by: Claude Code:claude-opus-5-5
has_pnpm now needs `pnpm --version` to succeed, not just to spawn: a resolved .cmd shim starts through cmd.exe even when the shim is broken. The shim guard now also covers `.cmd` spellings, a suite-local has_command, and the shared run_toolchain that pnpm_run uses. Refs #1054 Assisted-by: Claude Code:claude-opus-5-5
|
BugBot review Generated by Claude Code |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit c28558a. Configure here.
|
[agent] The full-scope run on c8f514e (38191238691) has one red job: Generated by Claude Code |
|
Ready for review (burn-down agent)
Generated by Claude Code |
|
Final review brief (final reviewer agent) What it does. On Windows, the pnpm-family e2e suites spawned Risk: low. The changes are test-only plus matrix keys in Look here
Verified
Changes I made: none. Open questions (non-blocking)
Auto-merge is armed, so approving sends this straight to the merge queue. Generated by Claude Code |
LLM Description written by Claude Code:claude-opus-5-5
Refs #1054 (the Windows/macOS slice; #1400 gated the Linux rows). Once this lands, every row of the three pnpm-family suites is gated, so the issue can close.
Root cause
On
windows-latestthe three pnpm-family e2e suites startpnpmandcorepackwith a bareCommand::new("pnpm")/Command::new("corepack"). Rust'sCommandonly looks for<name>.exeon PATH, while npm and Node install these tools as.cmdshims. Every availability probe therefore says the tool is missing and every test skips, and libtest still counts a skip as passed. From nightly run 38115955529:e2e_safety_pnpme2e_redirect_pnpm_builde2e_redirect_rush_simSo the Windows pnpm legs have tested nothing, even though the workflow installs pnpm on them. The macOS legs do run the tests.
What it does
hermetic::tool_command(name)(tests only) resolves a tool throughsocket_patch_core::utils::process::resolve_tool, the same PATHEXT-aware lookup the CLI uses and thatnpm_e2e_commonalready relies on. If the tool isn't on PATH it keeps the bare name, so spawning still fails the way the probes expect.e2e_safety_pnpm,e2e_redirect_pnpm_buildande2e_redirect_rush_simspawn everypnpm/corepack/npmthrough it, as doescommon::run_toolchain.pnpm_runusesrun_toolchain, and so donpm_runand the other*_runhelpers, so suites likee2e_npm/e2e_scannow resolvenpmthe same way. Nothing changes on Linux or macOS. On Windows a tool that used to fail to spawn now starts, and a probe that skips the test still runs before it, as before.e2e_safety_pnpmgets its own resolvedhas_pnpm()probe instead ofcommon::has_command.ci.yml:pnpm_required: '1'on the 3 Windows and 3 macOS rows of these suites, so a missing toolchain fails the leg instead of passing it.scripts/tests/test_ci_e2e_tiers.py: the gate test now requires the gate on every OS (ubuntu, windows, macos) for all three suites. A new check fails if any of the three suites spawns a barepnpm,corepackornpmagain.Left out on purpose:
common::has_commandkeeps its bare lookup. It's used by about 12 other suites (npm,yarn,bun,bundle, ...), and switching them all would un-skip Windows tests nobody has checked yet. That needs its own follow-up and its own full-scope run.Evidence
Python contract tests:
python3 -m pytest scripts/tests -qgives 335 passed, 6 skipped. Run against origin/main'sci.ymland suites, the newPnpmRequiredGatetests fail (15 subtests: the 6 Windows/macOS rows and the bare spawns). On this branch they pass.Linux, with
SOCKET_PATCH_PNPM_E2E_REQUIRED=1:e2e_safety_pnpm4 passed (2.86 s),e2e_redirect_pnpm_build --ignored --skip pnpm_pinned_matrix8 passed (25.4 s),e2e_redirect_rush_sim --ignored3 passed (72.0 s). These are real runs, not skips.spawn_env_hygiene13 passed.cargo fmt --all -- --checkandcargo clippy --workspace --all-features -- -D warningsare clean.actionlintandzizmor --offlinereport the same findings onci.ymlas on origin/main: none new.Windows/macOS proof: one full-scope run on c8f514e, 38191238691 (dispatched with
hosted_e2e=skip; c28558a only tightens the probe and the Python guard). All 6 gated Windows/macOS legs passed, and on Windows the tests now really run:e2e_safety_pnpme2e_redirect_pnpm_builde2e_redirect_rush_simThe 3 gated macOS legs passed as well. The run's only red job,
test (macos-latest, 1), is a Go unit test that is already failing on main (from Fix Go replaces that go.work ignores (#393, #458, #531) #1393), unrelated to this PR. Filed as Go go.work audit: false NotAMember for a use path through a missing dir on macOS (breaks macOS test job) #1409.PR CI on c28558a:
ci-okand every other check green. Bugbot found no issues./code-review high
Fixed in c28558a:
has_pnpmnow also requirespnpm --versionto exit 0. On Windows a resolved.cmdshim runs throughcmd.exe, so a successful spawn alone proved nothing.tool_commanddoc comment no longer claims full parity with the CLI. The CLI also has an App Execution Alias fallback, which this helper doesn't need..cmdspellings, checks rush_sim's localhas_command, and checks the sharedrun_toolchainthatpnpm_runuses.Not fixed here, on purpose (follow-up on #1054 / #824):
common::has_commandresolve shims for every caller, and drop the localhas_pnpmand rush_simhas_commandcopies. About 12 suites probenpm/yarn/bun/bundlethrough it. On Windows that would un-skip tests (e2e_npm,e2e_scan,e2e_hosted_production,e2e_vendored_production, ...) that have never run there. They need their own full-scope run and probably their own fixes.corepack/npmspawns in other suites (e2e_vendor_pnpm_build,mode_migration_npm,e2e_vendored_production,yarn_classic_vex,e2e_vendor_yarn_classic_dev_flow,in_process_alternate_installers). None of them runs in a Windows CI row today, so they skip only on a developer's Windows machine. Same follow-up.npm_e2e_common::path_npmandyarn_berry_common::corepack_commandintohermetic::tool_command. A helper cleanup, out of scope here.CI cost
The changed rows run only in the full tier (schedule / dispatch /
CI_SCOPE=full). A lean PR or merge-queue run is unchanged: same ~28 Linux jobs, about 30 job-minutes, about 8 min wall time. In the nightly, the 3 Windows legs will now run their tests: about +0.5 min (safety), +0.3 min (pnpm build) and +1.2 min (rush sim), based on the macOS timings. Measured: about +3 Windows job-minutes a night. No job is added.🤖 Generated with Claude Code
https://claude.ai/code/session_01GMkBLzuHJrRmvDmWU3neVb
Generated by Claude Code