diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/README.md b/crates/vp_cli_snapshots/tests/cli_snapshots/README.md index f0578b4604..9d458b5c12 100644 --- a/crates/vp_cli_snapshots/tests/cli_snapshots/README.md +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/README.md @@ -83,6 +83,7 @@ cwd = "packages/app" # optional, relative to the fixture root skip-platforms = ["windows"] # or { os = "linux", libc = "musl" } requires = ["bash"] # "sh" | "bash" | "zsh" | "cmd" | "fish" | "nu" | "pwsh" ignore = false # true: only runs with `-- --ignored` +serial = false # true: run alone across cargo test/nextest workers seed-runtime = true # false: start from an empty VP_HOME link-node-modules = false # true: expose the run-root node_modules as # the workspace's parent-dir node_modules, diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_add_npm10/snapshots.toml b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_add_npm10/snapshots.toml index 87c5c2afbc..7032fef611 100644 --- a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_add_npm10/snapshots.toml +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_add_npm10/snapshots.toml @@ -1,6 +1,7 @@ [[case]] name = "command_add_npm10" vp = "global" +serial = true skip-platforms = ["windows"] steps = [ { argv = ["vp", "add", "--help"], comment = "should show help", continue-on-failure = true }, diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_add_npm10_with_workspace/snapshots.toml b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_add_npm10_with_workspace/snapshots.toml index 763727776f..28b2742950 100644 --- a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_add_npm10_with_workspace/snapshots.toml +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_add_npm10_with_workspace/snapshots.toml @@ -1,6 +1,7 @@ [[case]] name = "command_add_npm10_with_workspace" vp = "global" +serial = true skip-platforms = ["windows"] steps = [ { argv = ["vp", "add", "testnpm2", "-D", "-w", "--", "--no-audit"], comment = "should add package to workspace root" }, diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_cache_npm10/snapshots.toml b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_cache_npm10/snapshots.toml index 48acea1e7b..40773ed7a3 100644 --- a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_cache_npm10/snapshots.toml +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_cache_npm10/snapshots.toml @@ -1,6 +1,7 @@ [[case]] name = "command_cache_npm10" vp = "global" +serial = true skip-platforms = ["windows"] steps = [ { argv = ["vp", "pm", "cache", "dir"], comment = "should show cache directory (uses npm config get cache)", continue-on-failure = true }, diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_config_npm10/snapshots.toml b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_config_npm10/snapshots.toml index b4ccc4b942..1e4344f9a0 100644 --- a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_config_npm10/snapshots.toml +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_config_npm10/snapshots.toml @@ -1,6 +1,7 @@ [[case]] name = "command_config_npm10" vp = "global" +serial = true steps = [ { argv = ["vp", "pm", "config", "--help"], comment = "should show help", continue-on-failure = true }, { argv = ["vp", "pm", "config", "get", "vite-plus-pm-config-test-key", "--location", "project"], comment = "should get config value from project scope", continue-on-failure = true }, diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_dedupe_npm10/snapshots.toml b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_dedupe_npm10/snapshots.toml index 8aa0d924ef..a2e69a09d5 100644 --- a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_dedupe_npm10/snapshots.toml +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_dedupe_npm10/snapshots.toml @@ -1,6 +1,7 @@ [[case]] name = "command_dedupe_npm10" vp = "global" +serial = true steps = [ { argv = ["vp", "dedupe"], comment = "should dedupe dependencies" }, { argv = ["vpt", "print-file", "package.json"], continue-on-failure = true }, diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_dlx_no_package_json/snapshots.toml b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_dlx_no_package_json/snapshots.toml index fe51954442..534a6ebeb6 100644 --- a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_dlx_no_package_json/snapshots.toml +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_dlx_no_package_json/snapshots.toml @@ -1,6 +1,7 @@ [[case]] name = "command_dlx_no_package_json" vp = "global" +serial = true skip-platforms = ["windows"] steps = [ { argv = ["vp", "dlx", "-s", "cowsay", "hello"], comment = "should work without package.json", continue-on-failure = true }, diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_dlx_npm10/snapshots.toml b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_dlx_npm10/snapshots.toml index 9ff9f86740..48d33b6331 100644 --- a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_dlx_npm10/snapshots.toml +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_dlx_npm10/snapshots.toml @@ -1,6 +1,7 @@ [[case]] name = "command_dlx_npm10" vp = "global" +serial = true local-registry = true skip-platforms = ["windows", { os = "linux", libc = "musl" }] steps = [ diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_link_npm10/snapshots.toml b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_link_npm10/snapshots.toml index 2bb9b564b7..501bbe8b0e 100644 --- a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_link_npm10/snapshots.toml +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_link_npm10/snapshots.toml @@ -1,6 +1,7 @@ [[case]] name = "command_link_npm10" vp = "global" +serial = true skip-platforms = ["windows"] steps = [ { argv = ["vpt", "mkdir", "-p", "../test-lib-npm"], comment = "create test library" }, diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_list_npm10/snapshots.toml b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_list_npm10/snapshots.toml index 6c9b7cb148..3a8d46a143 100644 --- a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_list_npm10/snapshots.toml +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_list_npm10/snapshots.toml @@ -1,6 +1,7 @@ [[case]] name = "command_list_npm10" vp = "global" +serial = true skip-platforms = ["windows"] steps = [ { argv = ["vp", "install"], comment = "should install packages first", continue-on-failure = true }, diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_list_npm10_with_workspace/snapshots.toml b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_list_npm10_with_workspace/snapshots.toml index fa9317a756..a819cc8e36 100644 --- a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_list_npm10_with_workspace/snapshots.toml +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_list_npm10_with_workspace/snapshots.toml @@ -1,6 +1,7 @@ [[case]] name = "command_list_npm10_with_workspace" vp = "global" +serial = true steps = [ { argv = ["vp", "install"], comment = "should install packages first", continue-on-failure = true }, { argv = ["vp", "pm", "list", "--json"], comment = "should list current workspace root dependencies", continue-on-failure = true }, diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_outdated_npm10/snapshots.toml b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_outdated_npm10/snapshots.toml index 414b4df6c0..4967722861 100644 --- a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_outdated_npm10/snapshots.toml +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_outdated_npm10/snapshots.toml @@ -1,6 +1,7 @@ [[case]] name = "command_outdated_npm10" vp = "global" +serial = true skip-platforms = ["windows"] steps = [ { argv = ["vp", "install"], comment = "should install packages first", continue-on-failure = true }, diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_outdated_npm10_with_workspace/snapshots.toml b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_outdated_npm10_with_workspace/snapshots.toml index 8e7a25d162..9120d69ddf 100644 --- a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_outdated_npm10_with_workspace/snapshots.toml +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_outdated_npm10_with_workspace/snapshots.toml @@ -1,6 +1,7 @@ [[case]] name = "command_outdated_npm10_with_workspace" vp = "global" +serial = true skip-platforms = ["windows"] steps = [ { argv = ["vp", "install"], continue-on-failure = true }, diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_owner_npm10/snapshots.toml b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_owner_npm10/snapshots.toml index b5bfd337d1..2d9c515936 100644 --- a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_owner_npm10/snapshots.toml +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_owner_npm10/snapshots.toml @@ -1,6 +1,7 @@ [[case]] name = "command_owner_npm10" vp = "global" +serial = true steps = [ { argv = ["vp", "pm", "owner", "list", "testnpm2"], comment = "should list package owners", continue-on-failure = true }, ] diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_pack_npm10/snapshots.toml b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_pack_npm10/snapshots.toml index 191e5e12db..100965dacf 100644 --- a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_pack_npm10/snapshots.toml +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_pack_npm10/snapshots.toml @@ -1,6 +1,7 @@ [[case]] name = "command_pack_npm10" vp = "global" +serial = true skip-platforms = ["windows"] steps = [ { argv = ["vp", "pm", "pack", "--json"], comment = "should pack current package" }, diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_pack_npm10_with_workspace/snapshots.toml b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_pack_npm10_with_workspace/snapshots.toml index caef1ef927..35f12c6f02 100644 --- a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_pack_npm10_with_workspace/snapshots.toml +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_pack_npm10_with_workspace/snapshots.toml @@ -1,6 +1,7 @@ [[case]] name = "command_pack_npm10_with_workspace" vp = "global" +serial = true skip-platforms = ["windows"] steps = [ { argv = ["vp", "pm", "pack", "--json"], comment = "should pack current workspace root", continue-on-failure = true }, diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_prune_npm10/snapshots.toml b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_prune_npm10/snapshots.toml index 17bc282947..b2a790f7e8 100644 --- a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_prune_npm10/snapshots.toml +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_prune_npm10/snapshots.toml @@ -1,6 +1,7 @@ [[case]] name = "command_prune_npm10" vp = "global" +serial = true steps = [ { argv = ["vp", "install"], comment = "should install packages first", continue-on-failure = true }, { argv = ["vp", "pm", "prune", "--help"], comment = "should show help", continue-on-failure = true }, diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_publish_npm10/snapshots.toml b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_publish_npm10/snapshots.toml index 4b195fefbb..f1b542612c 100644 --- a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_publish_npm10/snapshots.toml +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_publish_npm10/snapshots.toml @@ -1,6 +1,7 @@ [[case]] name = "command_publish_npm10" vp = "global" +serial = true steps = [ { argv = ["vp", "pm", "publish", "--help"], comment = "should show help", continue-on-failure = true }, { argv = ["vp", "pm", "publish", "--dry-run", "--", "--loglevel", "error"], comment = "should preview publish without actually publishing (uses npm publish --dry-run)", continue-on-failure = true }, diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_remove_npm10/snapshots.toml b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_remove_npm10/snapshots.toml index 4e1d763c0c..7829cfdacf 100644 --- a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_remove_npm10/snapshots.toml +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_remove_npm10/snapshots.toml @@ -1,6 +1,7 @@ [[case]] name = "command_remove_npm10" vp = "global" +serial = true skip-platforms = ["windows"] steps = [ { argv = ["vp", "remove", "testnpm2", "-D", "--", "--no-audit"], comment = "should pass when remove not exists package" }, diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_remove_npm10_with_workspace/snapshots.toml b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_remove_npm10_with_workspace/snapshots.toml index 7a448bd84a..0992679079 100644 --- a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_remove_npm10_with_workspace/snapshots.toml +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_remove_npm10_with_workspace/snapshots.toml @@ -1,6 +1,7 @@ [[case]] name = "command_remove_npm10_with_workspace" vp = "global" +serial = true skip-platforms = ["windows"] steps = [ { argv = ["vp", "add", "testnpm2", "-D", "-w", "--filter=*", "--", "--no-audit"], comment = "prepare packages" }, diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_unlink_npm10/snapshots.toml b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_unlink_npm10/snapshots.toml index 222a58a81f..938bf8f2ca 100644 --- a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_unlink_npm10/snapshots.toml +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_unlink_npm10/snapshots.toml @@ -1,6 +1,7 @@ [[case]] name = "command_unlink_npm10" vp = "global" +serial = true skip-platforms = ["windows"] steps = [ { argv = ["vpt", "mkdir", "-p", "../unlink-test-lib-npm"], comment = "create test library" }, diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_update_npm10/snapshots.toml b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_update_npm10/snapshots.toml index dbbb55e395..468723a645 100644 --- a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_update_npm10/snapshots.toml +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_update_npm10/snapshots.toml @@ -1,6 +1,7 @@ [[case]] name = "command_update_npm10" vp = "global" +serial = true skip-platforms = ["windows"] steps = [ { argv = ["vp", "update", "testnpm2", "--", "--no-audit"], comment = "should update package within semver range" }, diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_update_npm10_with_workspace/snapshots.toml b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_update_npm10_with_workspace/snapshots.toml index 689e92e4ce..a448827a17 100644 --- a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_update_npm10_with_workspace/snapshots.toml +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_update_npm10_with_workspace/snapshots.toml @@ -1,6 +1,7 @@ [[case]] name = "command_update_npm10_with_workspace" vp = "global" +serial = true skip-platforms = ["windows"] steps = [ { argv = ["vp", "update", "testnpm2", "-w", "--", "--no-audit"], comment = "should update in workspace root" }, diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_view_npm10/snapshots.toml b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_view_npm10/snapshots.toml index d752858e8c..76b2fbf90a 100644 --- a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_view_npm10/snapshots.toml +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_view_npm10/snapshots.toml @@ -1,6 +1,7 @@ [[case]] name = "command_view_npm10" vp = "global" +serial = true steps = [ { argv = ["vp", "pm", "view", "testnpm2", "dist.tarball"], comment = "should view testnpm2 package information", continue-on-failure = true }, { argv = ["vp", "pm", "info", "testnpm2", "dist.tarball"], comment = "should info alias to view", continue-on-failure = true }, diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_vpx_no_package_json/snapshots.toml b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_vpx_no_package_json/snapshots.toml index 7e9e4a20a1..0d5051379d 100644 --- a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_vpx_no_package_json/snapshots.toml +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_vpx_no_package_json/snapshots.toml @@ -1,6 +1,7 @@ [[case]] name = "command_vpx_no_package_json" vp = "global" +serial = true local-registry = true skip-platforms = ["windows"] steps = [ diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_why_npm10/snapshots.toml b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_why_npm10/snapshots.toml index af16781006..dc90b31600 100644 --- a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_why_npm10/snapshots.toml +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_why_npm10/snapshots.toml @@ -1,6 +1,7 @@ [[case]] name = "command_why_npm10" vp = "global" +serial = true skip-platforms = ["windows"] steps = [ { argv = ["vp", "install"], comment = "should install packages first", continue-on-failure = true }, diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_why_npm10_with_workspace/snapshots.toml b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_why_npm10_with_workspace/snapshots.toml index c0238f630d..b43ea4f876 100644 --- a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_why_npm10_with_workspace/snapshots.toml +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/command_why_npm10_with_workspace/snapshots.toml @@ -1,6 +1,7 @@ [[case]] name = "command_why_npm10_with_workspace" vp = "global" +serial = true skip-platforms = ["windows"] steps = [ { argv = ["vp", "install"], continue-on-failure = true }, diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_standalone_npm/package.json b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_standalone_npm/package.json index f496043e66..3394a3228b 100644 --- a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_standalone_npm/package.json +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_standalone_npm/package.json @@ -4,5 +4,5 @@ "vite": "^7.0.0", "vitest": "^4.0.0" }, - "packageManager": "npm@10.9.2" + "packageManager": "npm@11.13.0" } diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_standalone_npm/snapshots.toml b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_standalone_npm/snapshots.toml index 308750bfde..1d86c30245 100644 --- a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_standalone_npm/snapshots.toml +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_standalone_npm/snapshots.toml @@ -1,6 +1,7 @@ [[case]] name = "migration_standalone_npm" vp = "global" +serial = true skip-platforms = ["windows"] unset-env = ["CI", "VP_SKIP_INSTALL"] local-registry = true diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_standalone_npm/snapshots/migration_standalone_npm.md b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_standalone_npm/snapshots/migration_standalone_npm.md index f84432eb7f..05a6fe8589 100644 --- a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_standalone_npm/snapshots/migration_standalone_npm.md +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_standalone_npm/snapshots/migration_standalone_npm.md @@ -30,7 +30,7 @@ check package.json has overrides field (not pnpm.overrides) "overrides": { "vite": "npm:@voidzero-dev/vite-plus-core@" }, - "packageManager": "npm@10.9.2" + "packageManager": "npm@11.13.0" } ``` diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/npm_install_with_options/snapshots.toml b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/npm_install_with_options/snapshots.toml index df8b1f0249..bc53d44e18 100644 --- a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/npm_install_with_options/snapshots.toml +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/npm_install_with_options/snapshots.toml @@ -1,6 +1,7 @@ [[case]] name = "npm_install_with_options" vp = "local" +serial = true steps = [ { argv = ["vp", "install", "--help"], comment = "print help message", continue-on-failure = true }, { argv = ["vp", "run", "install"], comment = "https://docs.npmjs.com/cli/v10/commands/npm-install", continue-on-failure = true }, diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/pm_audit/snapshots.toml b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/pm_audit/snapshots.toml index 2eae308421..3c71ec1256 100644 --- a/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/pm_audit/snapshots.toml +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/pm_audit/snapshots.toml @@ -1,6 +1,7 @@ [[case]] name = "pm_audit_bun" vp = "global" +serial = true cwd = "bun" steps = [ { argv = ["vp", "install", "--", "--silent"], comment = "should install packages first", continue-on-failure = true }, diff --git a/crates/vp_cli_snapshots/tests/cli_snapshots/main.rs b/crates/vp_cli_snapshots/tests/cli_snapshots/main.rs index f5e7d8ea6c..d1803bca86 100644 --- a/crates/vp_cli_snapshots/tests/cli_snapshots/main.rs +++ b/crates/vp_cli_snapshots/tests/cli_snapshots/main.rs @@ -20,8 +20,10 @@ mod flavor; mod redact; use std::{ - collections::BTreeMap, + collections::{BTreeMap, hash_map::DefaultHasher}, ffi::OsString, + fs::{File, OpenOptions}, + hash::{Hash, Hasher}, io::Write, path::{Path, PathBuf}, sync::{Arc, Mutex, mpsc}, @@ -1530,33 +1532,56 @@ fn run_case( /// on Linux: only the few signal-sensitive cases pay for serialization, while /// the rest parallelize as they already do on macOS and Windows. /// -/// This coordinates threads within a single `cargo test` process, which is the -/// Linux and macOS snapshot jobs and the only place the parallel-PTY -/// signal-routing flakiness occurs. The Windows job runs the suite under -/// `cargo nextest`, which executes each trial in its own process; there the -/// gate is a no-op, but isolation is stronger for free — a signal-sensitive -/// case already has its own process, PTY, and process group, which is exactly -/// what this gate reconstructs for the shared-process case. +/// The in-process lock coordinates the threads used by `cargo test`. A matching +/// file lock coordinates the separate trial processes used by `cargo nextest` +/// on Windows. The lock file name includes the checkout path so independent +/// worktrees do not block each other. static EXECUTION_GATE: std::sync::RwLock<()> = std::sync::RwLock::new(()); /// Held for a case's whole run: either a shared read lease (parallel) or the /// exclusive write lease (isolated). Poisoning is ignored — a case that /// panicked already failed, and its neighbours should still run. enum GateLease { - Shared( - #[expect(dead_code, reason = "held for its Drop")] std::sync::RwLockReadGuard<'static, ()>, - ), - Exclusive( - #[expect(dead_code, reason = "held for its Drop")] std::sync::RwLockWriteGuard<'static, ()>, - ), + Shared { + #[expect(dead_code, reason = "held for its Drop")] + thread: std::sync::RwLockReadGuard<'static, ()>, + #[expect(dead_code, reason = "held for its Drop")] + process: File, + }, + Exclusive { + #[expect(dead_code, reason = "held for its Drop")] + thread: std::sync::RwLockWriteGuard<'static, ()>, + #[expect(dead_code, reason = "held for its Drop")] + process: File, + }, +} + +fn execution_gate_file() -> File { + let mut hasher = DefaultHasher::new(); + flavor::repo_root().hash(&mut hasher); + let path = std::env::temp_dir() + .join(format!("vp-cli-snapshots-execution-{:016x}.lock", hasher.finish())); + OpenOptions::new() + .create(true) + .read(true) + .write(true) + .truncate(false) + .open(&path) + .unwrap_or_else(|error| panic!("failed to open execution gate {}: {error}", path.display())) } fn acquire_gate(isolated: bool) -> GateLease { use std::sync::PoisonError; if isolated { - GateLease::Exclusive(EXECUTION_GATE.write().unwrap_or_else(PoisonError::into_inner)) + let thread = EXECUTION_GATE.write().unwrap_or_else(PoisonError::into_inner); + let process = execution_gate_file(); + File::lock(&process).expect("failed to lock the cross-process execution gate"); + GateLease::Exclusive { thread, process } } else { - GateLease::Shared(EXECUTION_GATE.read().unwrap_or_else(PoisonError::into_inner)) + let thread = EXECUTION_GATE.read().unwrap_or_else(PoisonError::into_inner); + let process = execution_gate_file(); + File::lock_shared(&process).expect("failed to lock the cross-process execution gate"); + GateLease::Shared { thread, process } } }