Skip to content
Open
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
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1156,7 +1156,7 @@ jobs:
vp uninstall -g typescript

git config --global --add safe.directory /workspace
RUST_BACKTRACE=1 pnpm test
RUST_BACKTRACE=1 pnpm test:unit
"

# Regression test for #2278: Debian slim images ship no ca-certificates
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/upgrade-deps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ jobs:

### Final validation (this step is complete ONLY when all pass)
1. `just build` exits 0.
2. `pnpm bootstrap-cli:ci && pnpm test` exits 0.
2. `pnpm bootstrap-cli:ci && pnpm test:unit` exits 0.
3. `just snapshot-test` exits 0. Snapshot mismatches fail the run with a
unified diff. Re-record with `UPDATE_SNAPSHOTS=1` only for cosmetic
drift from the upgrade (e.g. a bumped version string in help output);
Expand All @@ -181,7 +181,7 @@ jobs:

### Running long commands (IMPORTANT)
Run every long-running command (`just build`, `pnpm bootstrap-cli:ci`,
`pnpm test`, `cargo check`, etc.) in the FOREGROUND — a single Bash tool call
`pnpm test:unit`, `cargo check`, etc.) in the FOREGROUND — a single Bash tool call
that blocks until the command exits. The Bash tool already gives you a 10-minute
timeout per call, which is enough for these builds.

Expand Down
15 changes: 13 additions & 2 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -81,15 +81,26 @@ test:
$packages = Get-ChildItem -Path crates -Directory | Where-Object { $_.Name -ne 'vp_cli_snapshots' } | ForEach-Object { '-p'; $_.Name }; $Env:RUST_MIN_STACK='8388608'; $Env:__COMPAT_LAYER='RunAsInvoker'; cargo test @packages -p vite-plus-cli

# PTY-based CLI snapshot tests (crates/vp_cli_snapshots). Builds the global
# binary and shim template first so the runner never tests a stale build.
# binary and shim template first so the runner never tests a stale build, and
# installs Playwright Chromium for the browser-mode cases (idempotent).
# Filter by trial name substring: `just snapshot-test create`. Accept snapshot changes with
# `UPDATE_SNAPSHOTS=1 just snapshot-test`. Local-flavor cases additionally
# need a built packages/cli (`pnpm build`); the runner fails fast when dist
# is missing or stale. Use snapshot-test-global on checkouts without one.
snapshot-test *args='':
snapshot-test *args='': _install_chromium
cargo build -p vp_global_cli -p vp_trampoline
cargo test -p vp_cli_snapshots -- {{args}}

# Browser-mode snapshot cases run with PLAYWRIGHT_BROWSERS_PATH=0, so the
# browser must be installed into node_modules with the same setting.
[unix]
_install_chromium:
PLAYWRIGHT_BROWSERS_PATH=0 pnpm exec playwright install chromium

[windows]
_install_chromium:
$Env:PLAYWRIGHT_BROWSERS_PATH='0'; pnpm exec playwright install chromium

# Global flavor + vpt cases only: needs no JS build, for Rust-side work on
# a checkout that never ran `pnpm build`.
[unix]
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
"local-registry:kill": "node packages/tools/src/local-npm-registry.ts --kill",
"tsgo": "tsgo -b tsconfig.json",
"lint": "vp lint --type-aware --type-check --threads 4",
"test": "vp test run",
"test": "vp test && just snapshot-test",
"snapshot-test": "just snapshot-test",
"test:unit": "vp test",
"fmt": "vp fmt",
"test:unit": "vp test run",
"docs:dev": "pnpm -C docs dev",
"docs:build": "pnpm -C docs build",
"docs:update-trusted-stack-stats": "pnpm -C docs update-trusted-stack-stats",
Expand Down
Loading