GeezerVison is showing github.com — Tracking: migrate legacy snap tests to the PTY snapshot suite · Issue #2116 · voidzero-dev/vite-plus
Tracking: migrate legacy snap tests to the PTY snapshot suite #2116Closed 1 / 11 of 1 issue completedClosed Task 1 / 11 of 1 issue completed DescriptionThe legacy snap-test suites (packages/cli/snap-tests, packages/cli/snap-tests-global) are being migrated to the PTY snapshot suite under crates/vite_cli_snapshots. This issue tracks the remaining categories. Related: #2078 (closed, migration problems).
Status
492 legacy cases on main: all migrated or in-flight. #2143 empties both legacy trees and teaches the legacy runner to exit cleanly when a tree is gone from a fresh checkout (git does not track empty dirs).
#2143 also removes the cli-snap-test CI jobs, .github/scripts/retry-failed-snap-tests.sh, and the trees' Renovate ignorePaths. #2145 removes the parked snap-tests-todo tree (three cases no runner referenced). Follow-up after the stack merges: delete the legacy runner (packages/tools/src/snap-test.ts) and the migrate-snap-tests migrator.
Done / in-flight:
-
migration-* (149) — test(snapshots): migrate vp migrate snap test cases #2107
-
shim-* (11) — test(snapshots): migrate shim snap test cases #2109
-
check-* (34: 30 migrated + 4 check-pass* already covered by existing fixtures) — test(snapshots): migrate vp check cases to the PTY snapshot suite #2117
-
vite-* (11) — test(snapshots): migrate vite-* cases to the PTY snapshot suite #2118
-
npm-* local (1, npm-install-with-options) — test(snapshots): migrate the local npm install case to the PTY snapshot suite #2119
-
vp-* (10) — test(snapshots): migrate vp-* cases to the PTY snapshot suite #2120
- tail (19 of 23 misc single/pair categories: workspace, synthetic, plain, yarn, task, run, exit, change, ignore_dist, fallback, dev, runtime, global, delegate) — test(snapshots): migrate the misc tail cases to the PTY snapshot suite #2121
-
lint-* / oxlint-* (6) — test(snapshots): migrate lint-*/oxlint-* cases to the PTY snapshot suite #2131
-
test-* / fmt-* / cache-* (11) — test(snapshots): migrate test-*/fmt-*/cache-* cases to the PTY snapshot suite #2132
-
npm-global-* (9 of 10) — test(snapshots): migrate npm-global-* cases to the PTY snapshot suite #2134, unblocked by test(snapshots): expose Vite+ managed binaries with vp env setup #2110 (allow-list removal); adds vpt stat-file symlink state and $VP_HOME arg expansion
-
env-* (5) — test(snapshots): migrate env-* cases to the PTY snapshot suite #2137
-
command-* toolchain (~112: cache, check, config, dev, dlx, doc, env, exec, fmt, helper, info, init, lint, nested, node, pack, pm, preview, rebuild, run, staged, upgrade, version, vp-alias, vpr, vpx) — test(snapshots): migrate the command-* toolchain cases to the PTY snapshot suite #2138
-
command-* package-manager passthrough (~108: add, dedupe, install, link, list, outdated, owner, prune, publish, remove, unlink, update, view, why across npm/pnpm/yarn/bun) — test(snapshots): migrate the command-* package-manager passthrough cases #2141
- blocked tail (10: external-vp setup, custom-prefix npm install, corepack shims, npm shim downloads, recursive shim binary, bin wrappers, fingerprint/browser-mode placeholders) — test(snapshots): migrate the last blocked snap tests to the PTY suite #2143, unblocked by
${NAME} step-env expansion and case-root program resolution
- Unblocked by fix(snapshots): scope registry teardown signal #2115 (local-registry teardown signal fix for the Linux snapshot job, merged)
Formerly blocked (resolved by #2143)
command-env-setup-external-vp, npm-global-install-custom-prefix-on-path, shim-corepack-enable-install-directory: step env values now expand ${NAME} (${workspace} = step working dir, other names from the case env), covering the dynamic VP_HOME="$(pwd)/home" / PATH="$(pwd)/bin:$PATH" forms.
bin-oxlint-wrapper, bin-oxfmt-wrapper: the case root now exposes the run-root node_modules, so ../node_modules/vite-plus/bin/* resolves like the legacy layout.
vitest-browser-mode, fingerprint-ignore-test: migrated as fixtures with skip-platforms = [linux, windows, macos], matching the legacy suite; they record no snapshot until re-enabled.
How to migrate
Convert with node packages/tools/src/bin.js migrate-snap-tests <case...> (see crates/vite_cli_snapshots/tests/cli_snapshots/README.md). New fixtures live under crates/vite_cli_snapshots/tests/cli_snapshots/fixtures/; delete the legacy dirs in the same PR. Steps using shell operators need hand-conversion: cat f | grep x becomes vpt grep-file f x; cmd 2>&1 | grep 'marker' becomes just cmd (the PTY snapshot captures the full combined output, so the marker is asserted by the snapshot).
Notes
- The new suite's
create_*, new_*, config_*, build_* fixtures are net-new tests, not migrations, so they don't reduce the legacy count.
- Scaffold-generator cases (that run an external generator) need
node_modules the new PTY runner doesn't link; leave those in the legacy tree until the runner links them.
Reacted by Liang Reacted by JongKyung Lee Sub-issuesCollapse Sub-issuesSub-issues1 of 11 of 1 Issues completedLoading 1 sub-issues MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|