Repository navigation
fix(tests): Parallels snapshot checks unexpectedly contact npm - #130638
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
The snapshot-test repair is ready to land at Both snapshot cases failed before the change with a real npm E404; afterward the same five-suite order passes all 155 tests. Exact-head CI run 33035280497 completed successfully, including Separate live Parallels product runs found candidate companion-package and Windows Node-baseline issues; those are being repaired separately and are not hidden by this test-only PR. No live VM product pass is claimed here. |
|
Merged via squash.
|
What Problem This Solves
Resolves a problem where the Parallels macOS snapshot restoration checks fail before reaching the VM when npm is installed through Homebrew. Both powered-on and powered-off snapshot cases attempted a real lookup of the fixture package
[email protected], which returns E404.Related: #129788 (snapshot session preservation) and #129861 (network-free macOS upgrade preparation).
Why This Change Was Made
The fixture selected a registry target and intercepted npm only when its entrypoint ended in
npm-cli.js. The supported bare-npm runner can instead launch a Homebrew entrypoint namednpm, so that interception was incomplete. The default upgrade path already needs no host package lookup; use that canonical path and delete the obsolete npm preload/package override. An explicit assertion now confirms that the test reaches the intended guest-command failure after restoration.User Impact
No product runtime changes. Developers can run the snapshot checks without an external npm dependency, while retaining coverage that powered-on snapshots resume their saved session and powered-off snapshots start normally.
Evidence
On main commit
4b287caac326dd3a8b081754b61421cdb7120b98, both snapshot cases reproduced npm E404 before restoration. After this change, both pass and the original five-suite execution order passes all 155 tests:The changed gate passed test-root typechecking and script linting. Independent Codex autoreview reported no actionable findings. A live npm invocation probe confirmed the Homebrew entrypoint naming that caused the original fixture to miss interception. Separate real Parallels product smoke runs are in progress and are not claimed as completed evidence for this test-only change.
Production LOC: +0/-0. Tests: +2/-14 (net -12). No configuration, dependency, persistence, or protocol changes. AI-assisted.