Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion crates/vp_cli_snapshots/tests/cli_snapshots/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions crates/vp_cli_snapshots/tests/cli_snapshots/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
Loading