Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
294 changes: 154 additions & 140 deletions crates/vite_task/src/session/reporter/labeled.rs

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# Tests stdin inheritance behavior for spawned tasks.
#
# Stdin is inherited from the parent process only when BOTH conditions are met:
# 1. The reporter suggests inherited stdin (single spawn leaf in the graph, or synthetic execution)
# 1. The reporter suggests inherited stdin (the leaf is in a single-node graph chain,
# or the execution uses PlainReporter for synthetic execution)
# 2. Caching is disabled for the task (cache_metadata is None)
#
# Otherwise, stdin is set to /dev/null.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"name": "stdio-graph-criteria-test",
"private": true
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"name": "other"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"tasks": {
"check-tty": {
"command": "check-tty",
"cache": false
},
"bar": {
"command": "check-tty",
"cache": false
},
"foo-nested": {
"command": "vp run bar",
"cache": false
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
packages:
- packages/*
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Tests stdio suggestion criteria based on graph shape along each leaf path.
#
# Rules under test:
# - Suggest piped when the leaf's containing graph has more than one node, or
# any ancestor graph on its path has more than one node.
# - Suggest inherited only when every graph on the path (root + nested Expanded
# graphs) has exactly one node.

[[e2e]]
name = "single-node chains inherit even with multi-node sibling graph"
steps = [
"vp run foo",
]

[[e2e]]
name = "multi-node ancestor forces piped for nested single-node graph"
steps = [
"vp run -r foo-nested",
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
source: crates/vite_task_bin/tests/e2e_snapshots/main.rs
expression: e2e_outputs
---
> vp run -r foo-nested
~/packages/other$ check-tty ⊘ cache disabled: no cache config
stdin:not-tty
stdout:not-tty
stderr:not-tty

$ check-tty ⊘ cache disabled: no cache config
stdin:not-tty
stdout:not-tty
stderr:not-tty


━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Vite+ Task Runner • Execution Summary
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Statistics: 2 tasks • 0 cache hits • 0 cache misses • 2 cache disabled
Performance: 0% cache hit rate

Task Details:
────────────────────────────────────────────────
[1] other#bar: ~/packages/other$ check-tty ✓
→ Cache disabled in task configuration
·······················································
[2] stdio-graph-criteria-test#bar: $ check-tty ✓
→ Cache disabled in task configuration
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
---
source: crates/vite_task_bin/tests/e2e_snapshots/main.rs
expression: e2e_outputs
---
> vp run foo
$ check-tty ⊘ cache disabled: no cache config
stdin:tty
stdout:tty
stderr:tty

$ check-tty ⊘ cache disabled: no cache config
stdin:tty
stdout:tty
stderr:tty

~/packages/other$ check-tty ⊘ cache disabled: no cache config
stdin:not-tty
stdout:not-tty
stderr:not-tty

$ check-tty ⊘ cache disabled: no cache config
stdin:not-tty
stdout:not-tty
stderr:not-tty


━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Vite+ Task Runner • Execution Summary
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Statistics: 4 tasks • 0 cache hits • 0 cache misses • 4 cache disabled
Performance: 0% cache hit rate

Task Details:
────────────────────────────────────────────────
[1] stdio-graph-criteria-test#foo: $ check-tty ✓
→ Cache disabled in task configuration
·······················································
[2] stdio-graph-criteria-test#bar: $ check-tty ✓
→ Cache disabled in task configuration
·······················································
[3] other#check-tty: ~/packages/other$ check-tty ✓
→ Cache disabled in task configuration
·······················································
[4] stdio-graph-criteria-test#check-tty: $ check-tty ✓
→ Cache disabled in task configuration
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"cacheScripts": true,
"tasks": {
"check-tty": {
"command": "check-tty",
"cache": false
},
"bar": {
"command": "check-tty",
"cache": false
},
"foo": {
"command": "check-tty && vp run bar && vp run -r check-tty",
"cache": false
},
"foo-nested": {
"command": "vp run bar",
"cache": false
}
}
}
Loading