Commit 2d44be3
chore(test): mark integration tests as ignored to decouple from Node.js setup (#341)
## Motivation
Two goals, both aimed at making the test suite behave more like standard
libtest and be easier for humans and AI agents to reason about:
1. **Default `cargo test` should pass with only the Rust toolchain.**
Tests that need Node.js or `pnpm install` are marked `#[ignore]` (or
`ignore = true` in an `[[e2e]]` TOML block). AI agents and new
contributors can run and iterate on tests without the extra setup; CI
runs the Rust-only tests first, then sets up Node/pnpm and runs the
ignored set.
2. **Trial names should look like standard libtest identifiers.** Every
fixture folder name and `[[e2e]] / [[plan]]` case name is now
`[A-Za-z0-9_]` only, so `cargo test
task_select::interactive_select_task` works without quoting, snapshot
filenames carry no whitespace, and the mapping between a trial name and
its on-disk fixture is obvious. A build-time assertion rejects any
future name that breaks the rule.
## Key Changes
- **One libtest-mimic trial per e2e case** (was one per fixture).
`run_case_inner` → `run_case` takes a single `E2e`, trials are named
`{fixture}::{case}`, and per-case staging dirs
(`{fixture}_case_{index}`) keep parallel trials isolated.
- **`snapshots.toml` loaded once per fixture** at trial-list build time
via a new `load_snapshots_file` helper. The per-case runner no longer
re-reads the file.
- **`ignore = true` under `[[e2e]]`** maps directly onto
`libtest_mimic::Trial::with_ignored_flag(...)`.
- **Node.js / pnpm-dependent tests marked `#[ignore]`**:
- `crates/fspy/tests/node_fs.rs`: all 8 tests (need `node`)
- `crates/fspy/tests/oxlint.rs`: all 3 tests (need `oxlint` from
`packages/tools`)
-
`crates/vite_task_bin/tests/e2e_snapshots/fixtures/signal_exit/snapshots.toml`:
the single case that runs `node -e ...`
- **Fixture folder and case name normalization**: 35 e2e folders + 45
plan folders renamed (`task-select` → `task_select`, etc.); 149 e2e +
117 plan case names normalized (any non-`[A-Za-z0-9_]` → `_`); all
`.snap` / `.jsonc` files renamed in lock-step. Plan harness hardcoded
names updated: `"task graph"` → `"task_graph"`, `"task graph load
error"` → `"task_graph_load_error"`, `"query - {name}"` →
`"query_{name}"`.
- **Build-time guard**: both e2e and plan harnesses now call
`assert_identifier_like(...)` on fixture folder names and case names
during trial construction, so non-conforming entries fail loudly with a
clear message.
- **CI workflow reorder** (both the matrix `test` job and `test-musl`):
`cargo test --no-run` → `cargo test` → install Node.js + pnpm → `cargo
test -- --ignored`. The Rust-only run happens before Node/pnpm are on
PATH, enforcing the decoupling on every PR.
- **Docs**: `CONTRIBUTING.md` and `CLAUDE.md` describe the Rust-only
default and how to run the ignored subset (`cargo test --
--include-ignored` or `--ignored`) after `pnpm install` at the workspace
root (pnpm workspaces also install `packages/tools`).
## Implementation Details
- The `ignored` flag is applied via
`libtest_mimic::Trial::with_ignored_flag(bool)` — no reason string,
matching libtest-mimic's API.
- Platform filtering (`platform = "unix"` / `"windows"`) is now applied
during trial generation, so unmatched cases don't appear in the trial
list at all.
- A handful of gitignored fixture files (`dist/output.js`,
`node_modules/.bin/vt{,.cmd}`) needed `git add -f` at their new paths to
survive the folder rename.
https://claude.ai/code/session_01WHUFjqS6EbcoXp4UWHN1rj
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent 954cd3b commit 2d44be3
706 files changed
Lines changed: 420 additions & 346 deletions
File tree
- .github/workflows
- crates
- fspy/tests
- vite_task_bin/tests/e2e_snapshots
- fixtures
- associate_existing_cache
- snapshots
- builtin_different_cwd
- folder1
- folder2
- snapshots
- cache_disabled
- snapshots
- cache_miss_command_change
- snapshots
- cache_miss_reasons
- snapshots
- cache_subcommand
- snapshots
- cache_task_select
- snapshots
- src
- colon_in_name
- snapshots
- concurrent_execution
- packages
- a
- b
- snapshots
- ctrl_c
- packages
- a
- b
- snapshots
- error_cycle_dependency
- snapshots
- exit_codes
- packages
- pkg-a
- pkg-b
- snapshots
- filter_unmatched
- packages
- app
- lib
- snapshots
- glob_base_test
- other
- packages/sub-pkg
- other
- src
- snapshots
- src
- grouped_stdio
- packages/other
- snapshots
- individual_cache_for_adt_args
- snapshots
- individual_cache_for_env
- snapshots
- input_cache_test
- dist
- snapshots
- src
- sub
- test
- input_glob_meta_in_path
- packages/[lib]
- src
- snapshots
- input_negative_glob_subpackage
- packages
- sub-pkg
- dist
- src
- snapshots
- input_read_write_not_cached
- packages
- normal-pkg
- rw-pkg
- src
- touch-pkg
- src
- snapshots
- interleaved_stdio
- packages/other
- snapshots
- labeled_stdio
- packages/other
- snapshots
- malformed_fspy_path
- snapshots
- parallel_execution
- packages
- a
- b
- snapshots
- pass_args_to_task
- snapshots
- signal_exit
- snapshots
- summary_output
- packages
- a
- b
- snapshots
- task_list
- packages
- app
- lib
- snapshots
- task_no_trailing_newline
- snapshots
- task_select_truncate
- packages/app
- snapshots
- task_select
- packages
- app
- lib
- snapshots
- topological_execution_order
- packages
- app
- core
- lib
- snapshots
- vite_task_smoke
- snapshots
- workspace_root_self_reference
- packages
- a
- b
- snapshots
- vite_task_plan/tests/plan_snapshots
- fixtures
- additional_env
- snapshots
- cache_cli_override
- snapshots
- cache_keys
- snapshots
- cache_scripts_default
- snapshots
- cache_scripts_enabled
- snapshots
- cache_scripts_error_non_root
- packages/pkg-a
- snapshots
- cache_scripts_task_override
- snapshots
- cache_sharing
- snapshots
- cache_subcommand
- node_modules/.bin
- snapshots
- cache_tasks_disabled
- snapshots
- cache_true_no_force_enable
- snapshots
- cd_in_scripts
- snapshots
- comprehensive_task_graph
- packages
- api
- app
- config
- pkg#special
- tools
- ui
- snapshots
- conflict_test
- packages
- scope-a-b
- scope-a
- test-package
- snapshots
- cycle_dependency
- snapshots
- dependency_both_topo_and_explicit
- packages
- a
- b
- snapshots
- duplicate_package_names
- packages
- pkg-a
- pkg-b
- snapshots
- empty_package_test
- packages
- another-empty
- empty-name
- normal-package
- snapshots
- explicit_deps_workspace
- packages
- app
- core
- utils
- snapshots
- extra_args_not_forwarded_to_depends_on
- snapshots
- filter_workspace
- packages
- app
- cli
- core
- lib
- utils
- snapshots
- input_trailing_slash
- snapshots
- input_workspace_base
- packages/app
- snapshots
- nested_cache_override
- snapshots
- nested_tasks
- snapshots
- package_self_dependency
- packages/self-dep
- snapshots
- parallel_and_concurrency
- packages
- a
- b
- c
- snapshots
- pnpm-workspace-packages-optional
- pnpm_workspace_packages_optional
- snapshots
- recursive_topological_workspace
- apps/web
- packages
- app
- core
- utils
- snapshots
- script_conflict
- snapshots
- script_hooks_disabled
- snapshots
- script_hooks_nested_run
- snapshots
- script_hooks_task_no_hook
- snapshots
- script_hooks
- snapshots
- shell_fallback
- snapshots
- synthetic-cache-disabled
- synthetic_cache_disabled
- snapshots
- synthetic_in_subpackage
- packages/a
- snapshots
- transitive_skip_intermediate
- packages
- bottom
- middle
- top
- snapshots
- vpr_shorthand
- snapshots
- workspace_root_cd_no_skip
- packages/a
- snapshots
- workspace_root_depends_on_passthrough
- packages/a
- snapshots
- workspace_root_multi_command
- packages/a
- snapshots
- workspace_root_mutual_recursion
- packages/a
- snapshots
- workspace_root_no_package_json
- packages/pkg-a
- snapshots
- workspace_root_self_reference
- packages
- a
- b
- snapshots
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
123 | 123 | | |
124 | 124 | | |
125 | 125 | | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
126 | 135 | | |
127 | 136 | | |
128 | 137 | | |
| |||
143 | 152 | | |
144 | 153 | | |
145 | 154 | | |
146 | | - | |
147 | | - | |
148 | | - | |
149 | | - | |
150 | | - | |
| 155 | + | |
| 156 | + | |
151 | 157 | | |
152 | 158 | | |
153 | 159 | | |
| |||
186 | 192 | | |
187 | 193 | | |
188 | 194 | | |
189 | | - | |
190 | | - | |
191 | | - | |
192 | | - | |
193 | | - | |
194 | 195 | | |
195 | 196 | | |
196 | 197 | | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
197 | 201 | | |
198 | 202 | | |
199 | 203 | | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
200 | 212 | | |
201 | 213 | | |
202 | 214 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
12 | 12 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| 26 | + | |
26 | 27 | | |
27 | 28 | | |
28 | 29 | | |
29 | 30 | | |
30 | 31 | | |
31 | 32 | | |
32 | 33 | | |
| 34 | + | |
33 | 35 | | |
34 | 36 | | |
35 | 37 | | |
36 | 38 | | |
37 | 39 | | |
38 | 40 | | |
39 | 41 | | |
| 42 | + | |
40 | 43 | | |
41 | 44 | | |
42 | 45 | | |
43 | 46 | | |
44 | 47 | | |
45 | 48 | | |
46 | 49 | | |
| 50 | + | |
47 | 51 | | |
48 | 52 | | |
49 | 53 | | |
| |||
55 | 59 | | |
56 | 60 | | |
57 | 61 | | |
| 62 | + | |
58 | 63 | | |
59 | 64 | | |
60 | 65 | | |
| |||
68 | 73 | | |
69 | 74 | | |
70 | 75 | | |
| 76 | + | |
71 | 77 | | |
72 | 78 | | |
73 | 79 | | |
| |||
81 | 87 | | |
82 | 88 | | |
83 | 89 | | |
| 90 | + | |
84 | 91 | | |
85 | 92 | | |
86 | 93 | | |
87 | 94 | | |
88 | 95 | | |
89 | 96 | | |
90 | 97 | | |
| 98 | + | |
91 | 99 | | |
92 | 100 | | |
93 | 101 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
| 55 | + | |
55 | 56 | | |
56 | 57 | | |
57 | 58 | | |
| |||
69 | 70 | | |
70 | 71 | | |
71 | 72 | | |
| 73 | + | |
72 | 74 | | |
73 | 75 | | |
74 | 76 | | |
| |||
84 | 86 | | |
85 | 87 | | |
86 | 88 | | |
| 89 | + | |
87 | 90 | | |
88 | 91 | | |
89 | 92 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| |||
0 commit comments