diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/README.md b/crates/vp_cli_snapshots/tests/cli_snapshots/README.md index 5ffc728760..00d7e1b2ab 100644 --- a/crates/vp_cli_snapshots/tests/cli_snapshots/README.md +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/README.md @@ -243,7 +243,10 @@ preference inference or an empty installation must create a separate home, as th `shim_package_manager_setup` fixture does. The preparation command sets `VP_SELF_SETUP_NO_MODIFY_PATH=1` so Windows self-setup does not add temporary case homes to the user's persistent `PATH`. -This override applies only to runner preparation, not to fixture commands. +It also sets `VP_SKIP_DEPS_INSTALL=1`: the case home already has the checkout +package, and setup would otherwise look up the build's version on npm, which +is unpublished on a release branch. +These overrides apply only to runner preparation, not to fixture commands. A step is a bare argv array or a table: diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/snapshot_setup/verify.mjs b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/snapshot_setup/verify.mjs index 9f1b9b5d66..91233bf5b0 100644 --- a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/snapshot_setup/verify.mjs +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/snapshot_setup/verify.mjs @@ -9,6 +9,7 @@ const referenceHome = path.resolve('reference-home'); const reference = path.join(referenceHome, '.vite-plus'); const windows = process.platform === 'win32'; assert.equal(process.env.VP_SELF_SETUP_NO_MODIFY_PATH, undefined); +assert.equal(process.env.VP_SKIP_DEPS_INSTALL, undefined); if (windows) { const result = spawnSync( 'powershell.exe', @@ -46,10 +47,14 @@ for (const name of Object.keys(env)) { delete env[name]; } } +// Match the runner's preparation overrides. Without VP_SKIP_DEPS_INSTALL, +// setup looks up the platform package for the binary version on npm, which +// does not exist until that version is released. Object.assign(env, { VP_HOME: reference, VP_CLI_TEST: '1', VP_SELF_SETUP_NO_MODIFY_PATH: '1', + VP_SKIP_DEPS_INSTALL: '1', HOME: referenceHome, USERPROFILE: referenceHome, PATH: windows diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/main.rs b/crates/vp_cli_snapshots/tests/cli_snapshots/main.rs index 690c8e2fda..f7530e178b 100644 --- a/crates/vp_cli_snapshots/tests/cli_snapshots/main.rs +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/main.rs @@ -746,6 +746,12 @@ impl CaseHome { // to the real user's persistent PATH. Case commands do not // inherit this override, so self-setup fixtures retain coverage. .env("VP_SELF_SETUP_NO_MODIFY_PATH", "1") + // The checkout package is already installed in this home. Without + // this, a build with no `vp-install-lock.yaml` beside it looks up + // its own version's platform package on npm, which does not exist + // on a release branch before publishing. Case commands do not + // inherit this override either. + .env("VP_SKIP_DEPS_INSTALL", "1") .output() .map_err(|e| format!("failed to run first-start setup: {e}"))?; if output.status.success() {