Skip to content

Commit 88d719e

Browse files
branchseerclaude
andcommitted
test: add e2e test for bare directory name as explicit input
Verifies that inputs: ["src"] (a directory, not a glob) fingerprints nothing — file changes inside and folder deletion are both cache hits. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 7a277fd commit 88d719e

3 files changed

Lines changed: 45 additions & 0 deletions

File tree

crates/vite_task_bin/tests/e2e_snapshots/fixtures/inputs-cache-test/snapshots.toml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,3 +200,20 @@ steps = [
200200
# Run task without auto inference - should see (undefined)
201201
"vp run check-fspy-env-without-auto",
202202
]
203+
204+
# 8. Folder path as input: inputs: ["src"]
205+
# - A bare directory name matches nothing (directories are not files)
206+
# - File changes inside the folder should NOT trigger cache invalidation
207+
[[e2e]]
208+
name = "folder input - hit despite file changes and folder deletion"
209+
steps = [
210+
"vp run folder-input",
211+
# Modify a file inside the folder
212+
"replace-file-content src/main.ts initial modified",
213+
# Cache hit: "src" matches the directory itself, not files inside it
214+
"vp run folder-input",
215+
# Delete the entire folder
216+
"rm -rf src",
217+
# Cache hit: folder removal doesn't affect fingerprint
218+
"vp run folder-input",
219+
]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
source: crates/vite_task_bin/tests/e2e_snapshots/main.rs
3+
expression: e2e_outputs
4+
---
5+
> vp run folder-input
6+
$ print-file src/main.ts
7+
export const main = 'initial';
8+
> replace-file-content src/main.ts initial modified
9+
10+
> vp run folder-input
11+
$ print-file src/main.tscache hit, replaying
12+
export const main = 'initial';
13+
14+
---
15+
[vp run] cache hit, <duration> saved.
16+
> rm -rf src
17+
18+
> vp run folder-input
19+
$ print-file src/main.ts ✓ cache hit, replaying
20+
export const main = 'initial';
21+
22+
---
23+
[vp run] cache hit, <duration> saved.

crates/vite_task_bin/tests/e2e_snapshots/fixtures/inputs-cache-test/vite-task.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,11 @@
4444
"command": "print-env FSPY",
4545
"inputs": ["src/**/*.ts"],
4646
"cache": true
47+
},
48+
"folder-input": {
49+
"command": "print-file src/main.ts",
50+
"inputs": ["src"],
51+
"cache": true
4752
}
4853
}
4954
}

0 commit comments

Comments
 (0)