refactor(tests): split and improve snapshot test infrastructure#99
Merged
branchseer merged 11 commits intomainfrom Jan 13, 2026
Merged
refactor(tests): split and improve snapshot test infrastructure#99branchseer merged 11 commits intomainfrom
branchseer merged 11 commits intomainfrom
Conversation
340f691 to
006de3f
Compare
Member
Author
This stack of pull requests is managed by Graphite. Learn more about stacking. |
This was referenced Jan 13, 2026
fengmk2
approved these changes
Jan 13, 2026
Member
Author
Merge activity
|
Move test utilities from crates/vite_task_bin/test_bins to packages/tools for better organization. Rename package to vite-task-tools and update all references in test code and snapshots. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Move plan snapshot tests to vite_task_plan crate and keep e2e tests in vite_task_bin. This separation allows plan tests to run without the full binary dependencies while e2e tests retain access to the vite binary for integration testing. - Add vite_task_bin as dev-dependency to vite_task_plan for TaskSynthesizer implementation access - Create test_plan_snapshots in vite_task_plan with plan test code - Move 11 fixtures with plan/task-graph tests to vite_task_plan - Keep 6 e2e fixtures in vite_task_bin - Create 2 new e2e fixtures (e2e-lint-cache, e2e-env-test) for tests that were previously in shared fixtures Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Configure insta to write snapshot files directly into each fixture's snapshots/ directory instead of a centralized snapshots/ folder. This improves organization by keeping test inputs and outputs together. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Task graph snapshots are now only in vite_task_plan tests. Remove redundant task graph testing from vite_task_bin e2e tests and clean up unused code including Session initialization and redact_snapshot. Also remove unused transitive-dependency-workspace fixture which had no e2e tests. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Rename test_snapshots to e2e_snapshots in vite_task_bin - Rename test_plan_snapshots to plan_snapshots in vite_task_plan - Add README.md to both explaining what tests belong in each Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Use custom main functions instead of #[test] attributes for e2e_snapshots and plan_snapshots tests. This removes the standard test harness overhead and gives cleaner output. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add Step enum that allows e2e test steps to specify stdin content:
- Simple string: "vite build" (backwards compatible)
- Object with stdin: { cmd = "vite run echo", stdin = "hello" }
Add stdin-passthrough fixture to verify stdin is passed to tasks.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Allow filtering fixtures by name substring when running tests: - `cargo test -p vite_task_bin --test e2e_snapshots -- stdin` - `cargo test -p vite_task_plan --test plan_snapshots -- cache` Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Use /bin/sh on Unix and bash on Windows instead of @yarnpkg/shell for executing e2e test steps. This reduces test execution time by ~56%. Before: 12.8s After: 5.6s On Windows, looks for bash in BASH env var first, then falls back to Git Bash at C:\Program Files\Git\bin\bash.exe. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Remove serde_json, vite_graph_ser, vite_task_graph from vite_task_bin - Remove regex from vite_task_plan - Simplify get_shell_exe() to use cfg!(windows) instead of #[cfg] attrs Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
When using native bash with env_clear(), the child process loses PATHEXT which is needed by the which crate to find executables with extensions like .exe and .cmd on Windows. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
006de3f to
ff5435f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
test_snapshotsinto separateplan_snapshots(vite_task_plan) ande2e_snapshots(vite_task_bin) test suitestest_snapshots→e2e_snapshots,test_plan_snapshots→plan_snapshots)main()){ cmd = "...", stdin = "..." }syntax)cargo test --test e2e_snapshots -- stdin)Test plan
cargo test -p vite_task_bin --test e2e_snapshotspassescargo test -p vite_task_plan --test plan_snapshotspassescargo test -p vite_task_bin --test e2e_snapshots -- stdin🤖 Generated with Claude Code