test(scripts): restore pnpm test as the full gate - #2376
Conversation
…uite voidzero-dev#2146 removed the legacy snapshot infrastructure and trimmed the test script down to `vp test run`, leaving it identical to test:unit. Restore the historical two-tier semantics with the current PTY suite: pnpm test now runs the unit tests followed by `just snapshot-test`, while test:unit stays unit-only. The Alpine musl E2E job switches to pnpm test:unit because its container has no just or cargo (the legacy `pnpm -r snap-test` was node-only, which is why pnpm test used to work there). The upgrade-deps final validation folds its separate `just snapshot-test` step into the `pnpm test` step so the suite is not run twice.
Use pnpm test:unit in the final-validation gate instead of folding the snapshot suite into pnpm test. The agent re-records snapshot drift with UPDATE_SNAPSHOTS=1 just snapshot-test and re-runs only that step, so a combined gate would re-run the unit tests on every snapshot iteration and blur which suite failed.
✅ Deploy Preview for viteplus-preview canceled.
|
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: aaacade507
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| "tsgo": "tsgo -b tsconfig.json", | ||
| "lint": "vp lint --type-aware --type-check --threads 4", | ||
| "test": "vp test run", | ||
| "test": "vp test run && just snapshot-test", |
There was a problem hiding this comment.
Provision Chromium before adding snapshots to
pnpm test
On a fresh checkout following the documented just init and pnpm bootstrap-cli setup, this newly added command reaches the vitest_browser_mode snapshot case, which sets PLAYWRIGHT_BROWSERS_PATH=0 and launches Chromium, but neither setup command installs that browser. The dedicated snapshot jobs in .github/workflows/ci.yml explicitly run pnpm exec playwright install chromium with the same environment setting, so the documented full-validation command now fails for contributors unless they discover and perform this extra installation; provision Chromium during setup/the test script or otherwise make the browser case available to this gate.
AGENTS.md reference: AGENTS.md:L125-L125
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
This is a valid. I still think a single command that runs the whole test suite is worth having, so I'd like to address this by adding a playwright install chromium step to the snapshot-test recipe in the justfile. @fengmk2 what do you think?
Summary
pnpm testandpnpm test:unithave been identical (vp test run) since #2146 removed the legacy JS snapshot infrastructure and trimmed the snapshot half off thetestscript. Instead of deleting one of the duplicate scripts, this PR makespnpm testa single convenient command that runs the whole test surface.pnpm testnow runsvp test run && just snapshot-test(unit tests, then the PTY snapshot suite).pnpm test:unitstays unit-only.This also makes the pre-merge guidance in
CONTRIBUTING.mdandAGENTS.md(pnpm bootstrap-cli && pnpm test && git status, described as full validation) match what the command actually covers.CI adjustments
ci.yml): switched topnpm test:unitbecause the container has nojustor cargo to run the PTY suite. That coverage stays with the dedicatedcli-snapshot-testjobs.upgrade-deps.yml): step 2 now runspnpm test:unit, keepingjust snapshot-testas a separate step so a snapshot re-record does not re-run the unit tests.