Skip to content

Commit 1726f2e

Browse files
branchseerclaude
andcommitted
test: replace stdio e2e tests with per-mode coverage
Remove stdio-detection, stdin-inheritance, and stdio-graph-criteria fixtures. Replace with interleaved-stdio, labeled-stdio, and grouped-stdio fixtures that systematically cover all stdio cases for each --log mode. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 10c49aa commit 1726f2e

File tree

50 files changed

+400
-173
lines changed

Some content is hidden

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

50 files changed

+400
-173
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"name": "grouped-stdio-test",
3+
"private": true
4+
}

crates/vite_task_bin/tests/e2e_snapshots/fixtures/stdin-inheritance/packages/other/package.json renamed to crates/vite_task_bin/tests/e2e_snapshots/fixtures/grouped-stdio/packages/other/package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
{
22
"name": "other",
33
"scripts": {
4+
"check-tty": "check-tty",
5+
"check-tty-cached": "check-tty",
46
"read-stdin": "read-stdin"
57
}
68
}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
packages:
2+
- 'packages/*'
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# Tests stdio behavior in grouped mode (--log=grouped).
2+
#
3+
# In grouped mode, stdio is always piped regardless of cache state:
4+
# - stdin is /dev/null
5+
# - stdout/stderr are buffered per task and printed as a block on completion
6+
#
7+
# `check-tty` prints whether each stdio fd is a TTY.
8+
# `read-stdin` reads one line from stdin and prints it.
9+
10+
# ─── stdout/stderr: always piped (not-tty), output grouped ───
11+
12+
[[e2e]]
13+
name = "single task, cache off, grouped output"
14+
steps = ["vt run --log=grouped check-tty"]
15+
16+
[[e2e]]
17+
name = "multiple tasks, cache off, grouped output"
18+
steps = ["vt run --log=grouped -r check-tty"]
19+
20+
[[e2e]]
21+
name = "single task, cache miss, grouped output"
22+
steps = ["vt run --log=grouped check-tty-cached"]
23+
24+
[[e2e]]
25+
name = "multiple tasks, cache miss, grouped output"
26+
steps = ["vt run --log=grouped -r check-tty-cached"]
27+
28+
# ─── cache hit → replayed in grouped blocks ───────────────────
29+
30+
[[e2e]]
31+
name = "single task, cache hit, replayed"
32+
steps = ["vt run --log=grouped check-tty-cached", "vt run --log=grouped check-tty-cached"]
33+
34+
[[e2e]]
35+
name = "multiple tasks, cache hit, replayed"
36+
steps = ["vt run --log=grouped -r check-tty-cached", "vt run --log=grouped -r check-tty-cached"]
37+
38+
# ─── stdin: always null ───────────────────────────────────────
39+
40+
[[e2e]]
41+
name = "stdin is always null"
42+
steps = ["echo from-stdin | vt run --log=grouped read-stdin"]
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
---
2+
source: crates/vite_task_bin/tests/e2e_snapshots/main.rs
3+
expression: e2e_outputs
4+
---
5+
> vt run --log=grouped -r check-tty-cached
6+
[other#check-tty-cached] ~/packages/other$ check-tty
7+
── [other#check-tty-cached] ──
8+
stdin:not-tty
9+
stdout:not-tty
10+
stderr:not-tty
11+
12+
[grouped-stdio-test#check-tty-cached] $ check-tty
13+
── [grouped-stdio-test#check-tty-cached] ──
14+
stdin:not-tty
15+
stdout:not-tty
16+
stderr:not-tty
17+
18+
---
19+
vt run: 0/2 cache hit (0%). (Run `vt run --last-details` for full details)
20+
> vt run --log=grouped -r check-tty-cached
21+
[other#check-tty-cached] ~/packages/other$ check-ttycache hit, replaying
22+
── [other#check-tty-cached] ──
23+
stdin:not-tty
24+
stdout:not-tty
25+
stderr:not-tty
26+
27+
[grouped-stdio-test#check-tty-cached] $ check-ttycache hit, replaying
28+
── [grouped-stdio-test#check-tty-cached] ──
29+
stdin:not-tty
30+
stdout:not-tty
31+
stderr:not-tty
32+
33+
---
34+
vt run: 2/2 cache hit (100%), <duration> saved. (Run `vt run --last-details` for full details)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
source: crates/vite_task_bin/tests/e2e_snapshots/main.rs
3+
expression: e2e_outputs
4+
---
5+
> vt run --log=grouped -r check-tty-cached
6+
[other#check-tty-cached] ~/packages/other$ check-tty
7+
── [other#check-tty-cached] ──
8+
stdin:not-tty
9+
stdout:not-tty
10+
stderr:not-tty
11+
12+
[grouped-stdio-test#check-tty-cached] $ check-tty
13+
── [grouped-stdio-test#check-tty-cached] ──
14+
stdin:not-tty
15+
stdout:not-tty
16+
stderr:not-tty
17+
18+
---
19+
vt run: 0/2 cache hit (0%). (Run `vt run --last-details` for full details)

crates/vite_task_bin/tests/e2e_snapshots/fixtures/stdio-graph-criteria/snapshots/multi-node ancestor forces piped for nested single-node graph.snap renamed to crates/vite_task_bin/tests/e2e_snapshots/fixtures/grouped-stdio/snapshots/multiple tasks, cache off, grouped output.snap

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,15 @@
22
source: crates/vite_task_bin/tests/e2e_snapshots/main.rs
33
expression: e2e_outputs
44
---
5-
> vt run -r foo-nested
6-
~/packages/other$ check-ttycache disabled
5+
> vt run --log=grouped -r check-tty
6+
[other#check-tty] ~/packages/other$ check-tty
7+
── [other#check-tty] ──
78
stdin:not-tty
89
stdout:not-tty
910
stderr:not-tty
1011

11-
$ check-ttycache disabled
12+
[grouped-stdio-test#check-tty] $ check-ttycache disabled
13+
── [grouped-stdio-test#check-tty] ──
1214
stdin:not-tty
1315
stdout:not-tty
1416
stderr:not-tty
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
source: crates/vite_task_bin/tests/e2e_snapshots/main.rs
3+
expression: e2e_outputs
4+
---
5+
> vt run --log=grouped check-tty-cached
6+
[grouped-stdio-test#check-tty-cached] $ check-tty
7+
── [grouped-stdio-test#check-tty-cached] ──
8+
stdin:not-tty
9+
stdout:not-tty
10+
stderr:not-tty
11+
> vt run --log=grouped check-tty-cached
12+
[grouped-stdio-test#check-tty-cached] $ check-ttycache hit, replaying
13+
── [grouped-stdio-test#check-tty-cached] ──
14+
stdin:not-tty
15+
stdout:not-tty
16+
stderr:not-tty
17+
18+
---
19+
vt run: cache hit, <duration> saved.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
source: crates/vite_task_bin/tests/e2e_snapshots/main.rs
3+
expression: e2e_outputs
4+
---
5+
> vt run --log=grouped check-tty-cached
6+
[grouped-stdio-test#check-tty-cached] $ check-tty
7+
── [grouped-stdio-test#check-tty-cached] ──
8+
stdin:not-tty
9+
stdout:not-tty
10+
stderr:not-tty
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
source: crates/vite_task_bin/tests/e2e_snapshots/main.rs
3+
expression: e2e_outputs
4+
---
5+
> vt run --log=grouped check-tty
6+
[grouped-stdio-test#check-tty] $ check-ttycache disabled
7+
── [grouped-stdio-test#check-tty] ──
8+
stdin:not-tty
9+
stdout:not-tty
10+
stderr:not-tty

0 commit comments

Comments
 (0)