Skip to content

Commit 9a71d76

Browse files
branchseerclaude
andauthored
docs(test): move snapshots.toml comment to per-[[e2e]] level (#347)
## Summary - Drops the file-level `comment` field from `snapshots.toml` in the e2e harness; a `comment` now lives on each `[[e2e]]` entry and renders under that case's H1 heading. - Migrates every existing top-level comment into per-case comments, each written to describe what that individual case verifies (cache behaviors, stdio modes, selector flows, etc.). ## Test plan - [ ] `cargo test -p vite_task_bin --test e2e_snapshots` passes (148/148 locally) - [ ] Spot-check a few regenerated `.md` snapshots to confirm the new comments read sensibly under each H1 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 3e31eab commit 9a71d76

162 files changed

Lines changed: 792 additions & 676 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

crates/vite_task_bin/tests/e2e_snapshots/fixtures/associate_existing_cache/snapshots.toml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1+
[[e2e]]
2+
name = "associate_existing_cache"
13
comment = """
24
Tests that tasks with identical commands share cache
35
"""
4-
5-
[[e2e]]
6-
name = "associate_existing_cache"
76
steps = [
87
{ argv = [
98
"vt",

crates/vite_task_bin/tests/e2e_snapshots/fixtures/builtin_different_cwd/snapshots.toml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1+
[[e2e]]
2+
name = "builtin_different_cwd"
13
comment = """
24
Tests that synthetic tasks have separate cache per cwd
35
"""
4-
5-
[[e2e]]
6-
name = "builtin_different_cwd"
76
steps = [
87
{ argv = [
98
"vt",

crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache_disabled/snapshots.toml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
comment = """
2-
Tests that cache: false in task config disables caching
3-
"""
4-
51
[[e2e]]
62
name = "task_with_cache_disabled"
3+
comment = """
4+
A task configured with `cache: false` should re-run on every invocation instead of being cached.
5+
"""
76
steps = [
87
{ argv = [
98
"vt",
@@ -19,6 +18,9 @@ steps = [
1918

2019
[[e2e]]
2120
name = "task_with_cache_enabled"
21+
comment = """
22+
A task with caching enabled should produce a cache hit on the second run.
23+
"""
2224
steps = [
2325
{ argv = [
2426
"vt",

crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache_disabled/snapshots/task_with_cache_disabled.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# task_with_cache_disabled
22

3-
Tests that cache: false in task config disables caching
3+
A task configured with `cache: false` should re-run on every invocation instead of being cached.
44

55
## `vt run no-cache-task`
66

crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache_disabled/snapshots/task_with_cache_enabled.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# task_with_cache_enabled
22

3-
Tests that cache: false in task config disables caching
3+
A task with caching enabled should produce a cache hit on the second run.
44

55
## `vt run cached-task`
66

crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache_miss_command_change/snapshots.toml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1+
[[e2e]]
2+
name = "cache_miss_command_change"
13
comment = """
24
Tests cache behavior when command changes partially
35
"""
4-
5-
[[e2e]]
6-
name = "cache_miss_command_change"
76
steps = [
87
{ argv = [
98
"vt",

crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache_miss_reasons/snapshots.toml

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
comment = """
2-
Test all cache miss reason variants
3-
"""
4-
51
[[e2e]]
62
name = "env_value_changed"
3+
comment = """
4+
Changing the value of a tracked env var between runs should invalidate the cache.
5+
"""
76
steps = [
87
{ argv = [
98
"vt",
@@ -29,6 +28,9 @@ steps = [
2928

3029
[[e2e]]
3130
name = "env_added"
31+
comment = """
32+
Setting a tracked env var that was previously unset should invalidate the cache.
33+
"""
3234
steps = [
3335
{ argv = [
3436
"vt",
@@ -49,6 +51,9 @@ steps = [
4951

5052
[[e2e]]
5153
name = "env_removed"
54+
comment = """
55+
Unsetting a tracked env var that was previously set should invalidate the cache.
56+
"""
5257
steps = [
5358
{ argv = [
5459
"vt",
@@ -69,6 +74,9 @@ steps = [
6974

7075
[[e2e]]
7176
name = "untracked_env_added"
77+
comment = """
78+
Adding an `untrackedEnv` entry to the task config should invalidate the cache.
79+
"""
7280
steps = [
7381
{ argv = [
7482
"vt",
@@ -91,6 +99,9 @@ steps = [
9199

92100
[[e2e]]
93101
name = "untracked_env_removed"
102+
comment = """
103+
Removing an existing `untrackedEnv` entry from the task config should invalidate the cache.
104+
"""
94105
steps = [
95106
{ argv = [
96107
"vtt",
@@ -120,6 +131,9 @@ steps = [
120131

121132
[[e2e]]
122133
name = "cwd_changed"
134+
comment = """
135+
Changing the task's `cwd` should invalidate the cache, even if the input file exists at the new location.
136+
"""
123137
steps = [
124138
{ argv = [
125139
"vt",
@@ -154,6 +168,9 @@ steps = [
154168

155169
[[e2e]]
156170
name = "inferred_input_changes"
171+
comment = """
172+
Modifying, removing, and re-adding an input file (tracked via fspy inference) should each invalidate the cache.
173+
"""
157174
steps = [
158175
{ argv = [
159176
"vt",
@@ -197,6 +214,9 @@ steps = [
197214

198215
[[e2e]]
199216
name = "input_config_changed"
217+
comment = """
218+
Changing the task's `input` configuration should invalidate the cache even when the underlying files are unchanged.
219+
"""
200220
steps = [
201221
{ argv = [
202222
"vt",
@@ -219,6 +239,9 @@ steps = [
219239

220240
[[e2e]]
221241
name = "glob_input_changes"
242+
comment = """
243+
Modifying, adding, or removing files matched by a glob `input` pattern should each invalidate the cache.
244+
"""
222245
steps = [
223246
{ argv = [
224247
"vt",

crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache_miss_reasons/snapshots/cwd_changed.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# cwd_changed
22

3-
Test all cache miss reason variants
3+
Changing the task's `cwd` should invalidate the cache, even if the input file exists at the new location.
44

55
## `vt run test`
66

crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache_miss_reasons/snapshots/env_added.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# env_added
22

3-
Test all cache miss reason variants
3+
Setting a tracked env var that was previously unset should invalidate the cache.
44

55
## `vt run test`
66

crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache_miss_reasons/snapshots/env_removed.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# env_removed
22

3-
Test all cache miss reason variants
3+
Unsetting a tracked env var that was previously set should invalidate the cache.
44

55
## `MY_ENV=1 vt run test`
66

0 commit comments

Comments
 (0)