Skip to content

Commit 6854967

Browse files
branchseerclaude
andcommitted
test(output-cache): simplify fixtures, assert hit via replayed stdout
Drop the `&& vtt print done` tail from every task — it was padding to make cache-hit replay visible (write-only tasks have silent stdout) and to give the summary multiple items. Neither is load-bearing: each task already asserts restoration via an external `vtt print-file`. Restructure `explicit_input_ignores_fspy_reads` to a single `vtt print-file README.md` task. The second run captures "v1" replayed from the cache even after README.md has been changed to "v2" — a direct, self-evident assertion that the read was ignored instead of relying on partial-hit counters like `2/3 cache hit`. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 9507cfe commit 6854967

8 files changed

Lines changed: 15 additions & 79 deletions

crates/vite_task_bin/tests/e2e_snapshots/fixtures/output_cache_test/snapshots/auto_output___files_restored_on_cache_hit.md

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,6 @@
44

55
```
66
$ vtt write-file dist/out.txt built
7-
8-
$ vtt print done
9-
done
10-
11-
---
12-
vt run: 0/2 cache hit (0%). (Run `vt run --last-details` for full details)
137
```
148

159
## `vtt print-file dist/out.txt`
@@ -28,11 +22,8 @@ built
2822
```
2923
$ vtt write-file dist/out.txt built ◉ cache hit, replaying
3024
31-
$ vtt print done ◉ cache hit, replaying
32-
done
33-
3425
---
35-
vt run: 2/2 cache hit (100%). (Run `vt run --last-details` for full details)
26+
vt run: cache hit.
3627
```
3728

3829
## `vtt print-file dist/out.txt`

crates/vite_task_bin/tests/e2e_snapshots/fixtures/output_cache_test/snapshots/auto_output_with_non_auto_input.md

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,6 @@
44

55
```
66
$ vtt write-file dist/out.txt built
7-
8-
$ vtt print done
9-
done
10-
11-
---
12-
vt run: 0/2 cache hit (0%). (Run `vt run --last-details` for full details)
137
```
148

159
## `vtt rm dist/out.txt`
@@ -22,11 +16,8 @@ vt run: 0/2 cache hit (0%). (Run `vt run --last-details` for full details)
2216
```
2317
$ vtt write-file dist/out.txt built ◉ cache hit, replaying
2418
25-
$ vtt print done ◉ cache hit, replaying
26-
done
27-
2819
---
29-
vt run: 2/2 cache hit (100%). (Run `vt run --last-details` for full details)
20+
vt run: cache hit.
3021
```
3122

3223
## `vtt print-file dist/out.txt`

crates/vite_task_bin/tests/e2e_snapshots/fixtures/output_cache_test/snapshots/explicit_input_ignores_fspy_reads.md

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,6 @@
55
```
66
$ vtt print-file README.md
77
v1
8-
9-
$ vtt write-file dist/out.txt built
10-
11-
$ vtt print done
12-
done
13-
14-
---
15-
vt run: 0/3 cache hit (0%). (Run `vt run --last-details` for full details)
168
```
179

1810
## `vtt replace-file-content README.md v1 v2`
@@ -28,11 +20,6 @@ cache hit: README.md not in input globs
2820
$ vtt print-file README.md ◉ cache hit, replaying
2921
v1
3022
31-
$ vtt write-file dist/out.txt built ◉ cache hit, replaying
32-
33-
$ vtt print done ◉ cache hit, replaying
34-
done
35-
3623
---
37-
vt run: 3/3 cache hit (100%). (Run `vt run --last-details` for full details)
24+
vt run: cache hit.
3825
```

crates/vite_task_bin/tests/e2e_snapshots/fixtures/output_cache_test/snapshots/glob_output___only_matched_files_restored.md

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,8 @@ $ vtt write-file dist/out.txt built
77
88
$ vtt write-file tmp/temp.txt temp
99
10-
$ vtt print done
11-
done
12-
1310
---
14-
vt run: 0/3 cache hit (0%). (Run `vt run --last-details` for full details)
11+
vt run: 0/2 cache hit (0%). (Run `vt run --last-details` for full details)
1512
```
1613

1714
## `vtt rm dist/out.txt`
@@ -31,11 +28,8 @@ $ vtt write-file dist/out.txt built ◉ cache hit, replaying
3128
3229
$ vtt write-file tmp/temp.txt temp ◉ cache hit, replaying
3330
34-
$ vtt print done ◉ cache hit, replaying
35-
done
36-
3731
---
38-
vt run: 3/3 cache hit (100%). (Run `vt run --last-details` for full details)
32+
vt run: 2/2 cache hit (100%). (Run `vt run --last-details` for full details)
3933
```
4034

4135
## `vtt print-file dist/out.txt`

crates/vite_task_bin/tests/e2e_snapshots/fixtures/output_cache_test/snapshots/input_negative_does_not_drop_output_writes.md

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,6 @@
44

55
```
66
$ vtt write-file dist/out.txt built
7-
8-
$ vtt print done
9-
done
10-
11-
---
12-
vt run: 0/2 cache hit (0%). (Run `vt run --last-details` for full details)
137
```
148

159
## `vtt rm dist/out.txt`
@@ -22,11 +16,8 @@ vt run: 0/2 cache hit (0%). (Run `vt run --last-details` for full details)
2216
```
2317
$ vtt write-file dist/out.txt built ◉ cache hit, replaying
2418
25-
$ vtt print done ◉ cache hit, replaying
26-
done
27-
2819
---
29-
vt run: 2/2 cache hit (100%). (Run `vt run --last-details` for full details)
20+
vt run: cache hit.
3021
```
3122

3223
## `vtt print-file dist/out.txt`

crates/vite_task_bin/tests/e2e_snapshots/fixtures/output_cache_test/snapshots/negative_output___excluded_files_not_restored.md

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,8 @@ $ vtt write-file dist/out.txt built
77
88
$ vtt write-file dist/cache/tmp.txt temp
99
10-
$ vtt print done
11-
done
12-
1310
---
14-
vt run: 0/3 cache hit (0%). (Run `vt run --last-details` for full details)
11+
vt run: 0/2 cache hit (0%). (Run `vt run --last-details` for full details)
1512
```
1613

1714
## `vtt rm dist/out.txt`
@@ -31,11 +28,8 @@ $ vtt write-file dist/out.txt built ◉ cache hit, replaying
3128
3229
$ vtt write-file dist/cache/tmp.txt temp ◉ cache hit, replaying
3330
34-
$ vtt print done ◉ cache hit, replaying
35-
done
36-
3731
---
38-
vt run: 3/3 cache hit (100%). (Run `vt run --last-details` for full details)
32+
vt run: 2/2 cache hit (100%). (Run `vt run --last-details` for full details)
3933
```
4034

4135
## `vtt print-file dist/out.txt`

crates/vite_task_bin/tests/e2e_snapshots/fixtures/output_cache_test/snapshots/output_config_change_invalidates_cache.md

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,6 @@
44

55
```
66
$ vtt write-file dist/out.txt built
7-
8-
$ vtt print done
9-
done
10-
11-
---
12-
vt run: 0/2 cache hit (0%). (Run `vt run --last-details` for full details)
137
```
148

159
## `vtt replace-file-content vite-task.json REPLACE_ME dist/**`
@@ -23,10 +17,4 @@ cache miss: output config changed
2317

2418
```
2519
$ vtt write-file dist/out.txt built ○ cache miss: output configuration changed, executing
26-
27-
$ vtt print done ○ cache miss: output configuration changed, executing
28-
done
29-
30-
---
31-
vt run: 0/2 cache hit (0%). (Run `vt run --last-details` for full details)
3220
```

crates/vite_task_bin/tests/e2e_snapshots/fixtures/output_cache_test/vite-task.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,36 @@
11
{
22
"tasks": {
33
"auto-output": {
4-
"command": "vtt write-file dist/out.txt built && vtt print done",
4+
"command": "vtt write-file dist/out.txt built",
55
"cache": true
66
},
77
"glob-output": {
8-
"command": "vtt write-file dist/out.txt built && vtt write-file tmp/temp.txt temp && vtt print done",
8+
"command": "vtt write-file dist/out.txt built && vtt write-file tmp/temp.txt temp",
99
"output": ["dist/**"],
1010
"cache": true
1111
},
1212
"auto-output-no-auto-input": {
13-
"command": "vtt write-file dist/out.txt built && vtt print done",
13+
"command": "vtt write-file dist/out.txt built",
1414
"input": ["src/**"],
1515
"cache": true
1616
},
1717
"negative-output": {
18-
"command": "vtt write-file dist/out.txt built && vtt write-file dist/cache/tmp.txt temp && vtt print done",
18+
"command": "vtt write-file dist/out.txt built && vtt write-file dist/cache/tmp.txt temp",
1919
"output": [{ "auto": true }, "!dist/cache/**"],
2020
"cache": true
2121
},
2222
"output-config-change": {
23-
"command": "vtt write-file dist/out.txt built && vtt print done",
23+
"command": "vtt write-file dist/out.txt built",
2424
"output": ["REPLACE_ME"],
2525
"cache": true
2626
},
2727
"input-neg-dist-auto-output": {
28-
"command": "vtt write-file dist/out.txt built && vtt print done",
28+
"command": "vtt write-file dist/out.txt built",
2929
"input": [{ "auto": true }, "!dist/**"],
3030
"cache": true
3131
},
3232
"explicit-input-auto-output": {
33-
"command": "vtt print-file README.md && vtt write-file dist/out.txt built && vtt print done",
33+
"command": "vtt print-file README.md",
3434
"input": ["src/**"],
3535
"cache": true
3636
}

0 commit comments

Comments
 (0)