From 80d0cb0dda8364c978a18756be7c1492c722e419 Mon Sep 17 00:00:00 2001 From: branchseer Date: Sat, 28 Mar 2026 18:55:21 +0800 Subject: [PATCH 1/2] test(e2e): add argv step spawn mode Replace shell string steps with structured argv format in all e2e test fixtures. Steps now use `argv` arrays instead of shell command strings, with optional `comment` and `envs` fields: ```toml # Simple: steps = [["vt", "run", "build"]] # With metadata: steps = [{ argv = ["vt", "run", "test"], comment = "cache miss", envs = [["MY_ENV", "1"]] }] # Stdin piping via vtt helper (no shell): steps = [["vtt", "pipe-stdin", "from-stdin", "--", "vt", "run", "read-stdin"]] ``` Processes are spawned directly without a shell wrapper, avoiding shell interference with signal handling and exit codes. Programs are resolved from `CARGO_BIN_EXE_` env vars. Shell redirects are replaced with `vtt write-file` and `vtt pipe-stdin` helpers. Also documents Conventional Commits format for PR titles in CLAUDE.md. Co-Authored-By: Claude Opus 4.6 (1M context) --- CLAUDE.md | 2 + Cargo.lock | 3 + crates/vite_task_bin/Cargo.toml | 2 + crates/vite_task_bin/src/vtt/cp.rs | 7 + crates/vite_task_bin/src/vtt/main.rs | 12 +- crates/vite_task_bin/src/vtt/mkdir.rs | 21 ++ crates/vite_task_bin/src/vtt/pipe_stdin.rs | 33 +++ crates/vite_task_bin/src/vtt/rm.rs | 22 ++ crates/vite_task_bin/src/vtt/write_file.rs | 7 + .../associate-existing-cache/snapshots.toml | 26 +- .../builtin-different-cwd/snapshots.toml | 24 +- .../fixtures/cache-disabled/snapshots.toml | 26 +- .../cache-miss-command-change/snapshots.toml | 34 ++- .../cache-miss-reasons/snapshots.toml | 250 +++++++++++++++--- .../snapshots/cwd changed.snap | 4 +- .../snapshots/glob input changes.snap | 4 +- .../snapshots/inferred input changes.snap | 4 +- .../fixtures/cache-subcommand/snapshots.toml | 24 +- .../fixtures/colon-in-name/snapshots.toml | 13 +- .../concurrent-execution/snapshots.toml | 8 +- .../error_cycle_dependency/snapshots.toml | 2 +- .../fixtures/exit-codes/snapshots.toml | 14 +- .../fixtures/filter-unmatched/snapshots.toml | 12 +- ...atched exclusion filter does not warn.snap | 2 +- .../fixtures/glob-base-test/snapshots.toml | 48 ++-- .../fixtures/grouped-stdio/snapshots.toml | 42 ++- .../snapshots/stdin is always null.snap | 2 +- .../snapshots.toml | 28 +- .../individual-cache-for-env/snapshots.toml | 44 ++- .../fixtures/input-cache-test/snapshots.toml | 136 +++++----- ...pite file changes and folder deletion.snap | 2 +- .../input-glob-meta-in-path/snapshots.toml | 26 +- .../snapshots.toml | 48 ++-- .../snapshots.toml | 8 +- .../fixtures/interleaved-stdio/snapshots.toml | 16 +- .../snapshots/cache off inherits stdin.snap | 2 +- .../snapshots/cache on gets null stdin.snap | 2 +- .../fixtures/labeled-stdio/snapshots.toml | 42 ++- .../snapshots/stdin is always null.snap | 2 +- .../fixtures/pass-args-to-task/snapshots.toml | 8 +- .../snapshots.toml | 18 +- .../shared-caching-input/snapshots.toml | 32 ++- .../fixtures/signal-exit/snapshots.toml | 2 +- .../fixtures/summary-output/snapshots.toml | 79 +++++- .../fixtures/task-list/snapshots.toml | 10 +- .../list tasks from package dir.snap | 2 +- .../list tasks from workspace root.snap | 2 +- .../task-no-trailing-newline/snapshots.toml | 2 +- .../task-select-truncate/snapshots.toml | 5 +- .../fixtures/task-select/snapshots.toml | 81 ++++-- .../non-interactive did you mean.snap | 2 +- .../non-interactive list tasks from lib.snap | 2 +- .../snapshots/non-interactive list tasks.snap | 2 +- .../non-interactive no suggestions.snap | 2 +- ...non-interactive recursive typo errors.snap | 2 +- .../snapshots.toml | 6 +- .../fixtures/vite-task-smoke/snapshots.toml | 20 +- .../snapshots.toml | 4 +- .../vite_task_bin/tests/e2e_snapshots/main.rs | 138 ++++++---- 59 files changed, 1075 insertions(+), 348 deletions(-) create mode 100644 crates/vite_task_bin/src/vtt/cp.rs create mode 100644 crates/vite_task_bin/src/vtt/mkdir.rs create mode 100644 crates/vite_task_bin/src/vtt/pipe_stdin.rs create mode 100644 crates/vite_task_bin/src/vtt/rm.rs create mode 100644 crates/vite_task_bin/src/vtt/write_file.rs diff --git a/CLAUDE.md b/CLAUDE.md index 4bb704ea..9173704a 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -38,6 +38,8 @@ just doc # Documentation generation If `gt` (Graphite CLI) is available in PATH, use it instead of `gh` to create pull requests. +PR titles must use [Conventional Commits](https://www.conventionalcommits.org) format: `type(scope): summary` (scope is optional), e.g. `feat(cache): add LRU eviction`, `fix: handle symlink loops`, `test(e2e): add ctrl-c propagation test`. + ## Tests ```bash diff --git a/Cargo.lock b/Cargo.lock index d9b24f76..9e08fd4d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3849,6 +3849,7 @@ version = "1.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eab68b56840f69efb0fefbe3ab6661499217ffdc58e2eef7c3f6f69835386322" dependencies = [ + "serde", "smallvec 1.15.1", ] @@ -3988,9 +3989,11 @@ dependencies = [ "regex", "serde", "serde_json", + "shell-escape", "tempfile", "tokio", "toml", + "vec1", "vite_path", "vite_str", "vite_task", diff --git a/crates/vite_task_bin/Cargo.toml b/crates/vite_task_bin/Cargo.toml index d80200eb..4fbc99e2 100644 --- a/crates/vite_task_bin/Cargo.toml +++ b/crates/vite_task_bin/Cargo.toml @@ -36,8 +36,10 @@ pty_terminal = { workspace = true } pty_terminal_test = { workspace = true } regex = { workspace = true } serde = { workspace = true, features = ["derive", "rc"] } +shell-escape = { workspace = true } tempfile = { workspace = true } toml = { workspace = true } +vec1 = { workspace = true, features = ["serde"] } vite_path = { workspace = true, features = ["absolute-redaction"] } vite_workspace = { workspace = true } diff --git a/crates/vite_task_bin/src/vtt/cp.rs b/crates/vite_task_bin/src/vtt/cp.rs new file mode 100644 index 00000000..5e53dc83 --- /dev/null +++ b/crates/vite_task_bin/src/vtt/cp.rs @@ -0,0 +1,7 @@ +pub fn run(args: &[String]) -> Result<(), Box> { + if args.len() != 2 { + return Err("Usage: vtt cp ".into()); + } + std::fs::copy(&args[0], &args[1])?; + Ok(()) +} diff --git a/crates/vite_task_bin/src/vtt/main.rs b/crates/vite_task_bin/src/vtt/main.rs index bddaf857..48886445 100644 --- a/crates/vite_task_bin/src/vtt/main.rs +++ b/crates/vite_task_bin/src/vtt/main.rs @@ -8,20 +8,25 @@ mod barrier; mod check_tty; +mod cp; +mod mkdir; +mod pipe_stdin; mod print; mod print_cwd; mod print_env; mod print_file; mod read_stdin; mod replace_file_content; +mod rm; mod touch_file; +mod write_file; fn main() { let args: Vec = std::env::args().collect(); if args.len() < 2 { eprintln!("Usage: vtt [args...]"); eprintln!( - "Subcommands: barrier, check-tty, print, print-cwd, print-env, print-file, read-stdin, replace-file-content, touch-file" + "Subcommands: barrier, check-tty, cp, mkdir, pipe-stdin, print, print-cwd, print-env, print-file, read-stdin, replace-file-content, rm, touch-file, write-file" ); std::process::exit(1); } @@ -32,6 +37,8 @@ fn main() { check_tty::run(); Ok(()) } + "cp" => cp::run(&args[2..]), + "mkdir" => mkdir::run(&args[2..]), "print" => { print::run(&args[2..]); Ok(()) @@ -41,7 +48,10 @@ fn main() { "print-file" => print_file::run(&args[2..]), "read-stdin" => read_stdin::run(), "replace-file-content" => replace_file_content::run(&args[2..]), + "pipe-stdin" => pipe_stdin::run(&args[2..]), + "rm" => rm::run(&args[2..]), "touch-file" => touch_file::run(&args[2..]), + "write-file" => write_file::run(&args[2..]), other => { eprintln!("Unknown subcommand: {other}"); std::process::exit(1); diff --git a/crates/vite_task_bin/src/vtt/mkdir.rs b/crates/vite_task_bin/src/vtt/mkdir.rs new file mode 100644 index 00000000..efbafc45 --- /dev/null +++ b/crates/vite_task_bin/src/vtt/mkdir.rs @@ -0,0 +1,21 @@ +pub fn run(args: &[String]) -> Result<(), Box> { + let mut parents = false; + let mut paths = Vec::new(); + for arg in args { + match arg.as_str() { + "-p" => parents = true, + _ => paths.push(arg.as_str()), + } + } + if paths.is_empty() { + return Err("Usage: vtt mkdir [-p] ...".into()); + } + for path in paths { + if parents { + std::fs::create_dir_all(path)?; + } else { + std::fs::create_dir(path)?; + } + } + Ok(()) +} diff --git a/crates/vite_task_bin/src/vtt/pipe_stdin.rs b/crates/vite_task_bin/src/vtt/pipe_stdin.rs new file mode 100644 index 00000000..af4ea318 --- /dev/null +++ b/crates/vite_task_bin/src/vtt/pipe_stdin.rs @@ -0,0 +1,33 @@ +/// pipe-stdin `` -- `` [``...] +/// +/// Spawns `` with `` piped to its stdin, then exits with +/// the child's exit code. If `` is empty, an empty stdin is provided. +pub fn run(args: &[String]) -> Result<(), Box> { + let sep = args + .iter() + .position(|a| a == "--") + .ok_or("Usage: vtt pipe-stdin -- [args...]")?; + let data = &args[..sep].join(" "); + let cmd_args = &args[sep + 1..]; + if cmd_args.is_empty() { + return Err("Usage: vtt pipe-stdin -- [args...]".into()); + } + + let mut child = std::process::Command::new(&cmd_args[0]) + .args(&cmd_args[1..]) + .stdin(std::process::Stdio::piped()) + .spawn()?; + + { + use std::io::Write; + let mut stdin = child.stdin.take().unwrap(); + if !data.is_empty() { + stdin.write_all(data.as_bytes())?; + } + stdin.write_all(b"\n")?; + // stdin is closed when dropped, signaling EOF + } + + let status = child.wait()?; + std::process::exit(status.code().unwrap_or(1)); +} diff --git a/crates/vite_task_bin/src/vtt/rm.rs b/crates/vite_task_bin/src/vtt/rm.rs new file mode 100644 index 00000000..a8f98d6c --- /dev/null +++ b/crates/vite_task_bin/src/vtt/rm.rs @@ -0,0 +1,22 @@ +pub fn run(args: &[String]) -> Result<(), Box> { + let mut recursive = false; + let mut paths = Vec::new(); + for arg in args { + match arg.as_str() { + "-r" | "-rf" | "-f" => recursive = true, + _ => paths.push(arg.as_str()), + } + } + if paths.is_empty() { + return Err("Usage: vtt rm [-rf] ...".into()); + } + for path in paths { + let p = std::path::Path::new(path); + if p.is_dir() && recursive { + std::fs::remove_dir_all(p)?; + } else { + std::fs::remove_file(p)?; + } + } + Ok(()) +} diff --git a/crates/vite_task_bin/src/vtt/write_file.rs b/crates/vite_task_bin/src/vtt/write_file.rs new file mode 100644 index 00000000..f5539146 --- /dev/null +++ b/crates/vite_task_bin/src/vtt/write_file.rs @@ -0,0 +1,7 @@ +pub fn run(args: &[String]) -> Result<(), Box> { + if args.len() < 2 { + return Err("Usage: vtt write-file ".into()); + } + std::fs::write(&args[0], &args[1])?; + Ok(()) +} diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/associate-existing-cache/snapshots.toml b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/associate-existing-cache/snapshots.toml index cb717e55..ad6bd6b8 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/associate-existing-cache/snapshots.toml +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/associate-existing-cache/snapshots.toml @@ -3,8 +3,26 @@ [[e2e]] name = "associate existing cache" steps = [ - "vt run script1 # cache miss", - "vt run script2 # cache hit, same command as script1", - "vtt replace-file-content package.json '\"script2\": \"vtt print hello\"' '\"script2\": \"vtt print world\"' # change script2", - "vt run script2 # cache miss", + { argv = [ + "vt", + "run", + "script1", + ], comment = "cache miss" }, + { argv = [ + "vt", + "run", + "script2", + ], comment = "cache hit, same command as script1" }, + { argv = [ + "vtt", + "replace-file-content", + "package.json", + "\"script2\": \"vtt print hello\"", + "\"script2\": \"vtt print world\"", + ], comment = "change script2" }, + { argv = [ + "vt", + "run", + "script2", + ], comment = "cache miss" }, ] diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/builtin-different-cwd/snapshots.toml b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/builtin-different-cwd/snapshots.toml index 3851f92c..a6132a37 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/builtin-different-cwd/snapshots.toml +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/builtin-different-cwd/snapshots.toml @@ -3,8 +3,24 @@ [[e2e]] name = "builtin different cwd" steps = [ - "vt run cwd1 # cache miss in folder1", - "vt run cwd2 # cache miss in folder2 (different cwd)", - "vt run cwd1 # cache hit in folder1", - "vt run cwd2 # cache hit in folder2", + { argv = [ + "vt", + "run", + "cwd1", + ], comment = "cache miss in folder1" }, + { argv = [ + "vt", + "run", + "cwd2", + ], comment = "cache miss in folder2 (different cwd)" }, + { argv = [ + "vt", + "run", + "cwd1", + ], comment = "cache hit in folder1" }, + { argv = [ + "vt", + "run", + "cwd2", + ], comment = "cache hit in folder2" }, ] diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-disabled/snapshots.toml b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-disabled/snapshots.toml index ca04c0d3..9b63e9c0 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-disabled/snapshots.toml +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-disabled/snapshots.toml @@ -2,8 +2,30 @@ [[e2e]] name = "task with cache disabled" -steps = ["vt run no-cache-task # cache miss", "vt run no-cache-task # cache disabled, runs again"] +steps = [ + { argv = [ + "vt", + "run", + "no-cache-task", + ], comment = "cache miss" }, + { argv = [ + "vt", + "run", + "no-cache-task", + ], comment = "cache disabled, runs again" }, +] [[e2e]] name = "task with cache enabled" -steps = ["vt run cached-task # cache miss", "vt run cached-task # cache hit"] +steps = [ + { argv = [ + "vt", + "run", + "cached-task", + ], comment = "cache miss" }, + { argv = [ + "vt", + "run", + "cached-task", + ], comment = "cache hit" }, +] diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-command-change/snapshots.toml b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-command-change/snapshots.toml index e4d13a92..76ab70e8 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-command-change/snapshots.toml +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-command-change/snapshots.toml @@ -3,9 +3,33 @@ [[e2e]] name = "cache miss command change" steps = [ - "vt run task # cache miss", - "vtt replace-file-content vite-task.json 'vtt print foo && vtt print bar' 'vtt print baz && vtt print bar' # change first subtask", - "vt run task # first: cache miss, second: cache hit", - "vtt replace-file-content vite-task.json 'vtt print baz && vtt print bar' 'vtt print bar' # remove first subtask", - "vt run task # cache hit", + { argv = [ + "vt", + "run", + "task", + ], comment = "cache miss" }, + { argv = [ + "vtt", + "replace-file-content", + "vite-task.json", + "vtt print foo && vtt print bar", + "vtt print baz && vtt print bar", + ], comment = "change first subtask" }, + { argv = [ + "vt", + "run", + "task", + ], comment = "first: cache miss, second: cache hit" }, + { argv = [ + "vtt", + "replace-file-content", + "vite-task.json", + "vtt print baz && vtt print bar", + "vtt print bar", + ], comment = "remove first subtask" }, + { argv = [ + "vt", + "run", + "task", + ], comment = "cache hit" }, ] diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots.toml b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots.toml index 9709fef2..f93af4a3 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots.toml +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots.toml @@ -3,73 +3,257 @@ [[e2e]] name = "env value changed" steps = [ - "MY_ENV=1 vt run test # cache miss", - "MY_ENV=2 vt run test # cache miss: env value changed", + { argv = [ + "vt", + "run", + "test", + ], envs = [ + [ + "MY_ENV", + "1", + ], + ], comment = "cache miss" }, + { argv = [ + "vt", + "run", + "test", + ], envs = [ + [ + "MY_ENV", + "2", + ], + ], comment = "cache miss: env value changed" }, ] [[e2e]] name = "env added" -steps = ["vt run test # cache miss", "MY_ENV=1 vt run test # cache miss: env added"] +steps = [ + { argv = [ + "vt", + "run", + "test", + ], comment = "cache miss" }, + { argv = [ + "vt", + "run", + "test", + ], envs = [ + [ + "MY_ENV", + "1", + ], + ], comment = "cache miss: env added" }, +] [[e2e]] name = "env removed" -steps = ["MY_ENV=1 vt run test # cache miss", "vt run test # cache miss: env removed"] +steps = [ + { argv = [ + "vt", + "run", + "test", + ], envs = [ + [ + "MY_ENV", + "1", + ], + ], comment = "cache miss" }, + { argv = [ + "vt", + "run", + "test", + ], comment = "cache miss: env removed" }, +] [[e2e]] name = "untracked env added" steps = [ - "vt run test # cache miss", - """vtt replace-file-content vite-task.json '"cache": true' '"cache": true, "untrackedEnv": ["MY_UNTRACKED"]' # add untracked env""", - "vt run test # cache miss: untracked env added", + { argv = [ + "vt", + "run", + "test", + ], comment = "cache miss" }, + { argv = [ + "vtt", + "replace-file-content", + "vite-task.json", + "\"cache\": true", + "\"cache\": true, \"untrackedEnv\": [\"MY_UNTRACKED\"]", + ], comment = "add untracked env" }, + { argv = [ + "vt", + "run", + "test", + ], comment = "cache miss: untracked env added" }, ] [[e2e]] name = "untracked env removed" steps = [ - """vtt replace-file-content vite-task.json '"cache": true' '"cache": true, "untrackedEnv": ["MY_UNTRACKED"]' # setup""", - "vt run test # cache miss", - """vtt replace-file-content vite-task.json '"cache": true, "untrackedEnv": ["MY_UNTRACKED"]' '"cache": true' # remove untracked env""", - "vt run test # cache miss: untracked env removed", + { argv = [ + "vtt", + "replace-file-content", + "vite-task.json", + "\"cache\": true", + "\"cache\": true, \"untrackedEnv\": [\"MY_UNTRACKED\"]", + ], comment = "setup" }, + { argv = [ + "vt", + "run", + "test", + ], comment = "cache miss" }, + { argv = [ + "vtt", + "replace-file-content", + "vite-task.json", + "\"cache\": true, \"untrackedEnv\": [\"MY_UNTRACKED\"]", + "\"cache\": true", + ], comment = "remove untracked env" }, + { argv = [ + "vt", + "run", + "test", + ], comment = "cache miss: untracked env removed" }, ] [[e2e]] name = "cwd changed" steps = [ - "vt run test # cache miss", - "mkdir -p subfolder", - "cp test.txt subfolder/test.txt", - """vtt replace-file-content vite-task.json '"cache": true' '"cache": true, "cwd": "subfolder"' # change cwd""", - "vt run test # cache miss: cwd changed", + { argv = [ + "vt", + "run", + "test", + ], comment = "cache miss" }, + [ + "vtt", + "mkdir", + "-p", + "subfolder", + ], + [ + "vtt", + "cp", + "test.txt", + "subfolder/test.txt", + ], + { argv = [ + "vtt", + "replace-file-content", + "vite-task.json", + "\"cache\": true", + "\"cache\": true, \"cwd\": \"subfolder\"", + ], comment = "change cwd" }, + { argv = [ + "vt", + "run", + "test", + ], comment = "cache miss: cwd changed" }, ] [[e2e]] name = "inferred input changes" steps = [ - "vt run test # cache miss", - "vtt replace-file-content test.txt initial modified # modify input", - "vt run test # cache miss: input modified", - "rm test.txt # remove tracked input", - "vt run test # cache miss: input removed", - "echo new content > test.txt # recreate previously removed file", - "vt run test # cache miss: input added", + { argv = [ + "vt", + "run", + "test", + ], comment = "cache miss" }, + { argv = [ + "vtt", + "replace-file-content", + "test.txt", + "initial", + "modified", + ], comment = "modify input" }, + { argv = [ + "vt", + "run", + "test", + ], comment = "cache miss: input modified" }, + { argv = [ + "vtt", + "rm", + "test.txt", + ], comment = "remove tracked input" }, + { argv = [ + "vt", + "run", + "test", + ], comment = "cache miss: input removed" }, + { argv = [ + "vtt", + "write-file", + "test.txt", + "new content", + ], comment = "recreate previously removed file" }, + { argv = [ + "vt", + "run", + "test", + ], comment = "cache miss: input added" }, ] [[e2e]] name = "input config changed" steps = [ - "vt run test # cache miss", - """vtt replace-file-content vite-task.json '"cache": true' '"cache": true, "input": ["test.txt"]' # change input config""", - "vt run test # cache miss: configuration changed", + { argv = [ + "vt", + "run", + "test", + ], comment = "cache miss" }, + { argv = [ + "vtt", + "replace-file-content", + "vite-task.json", + "\"cache\": true", + "\"cache\": true, \"input\": [\"test.txt\"]", + ], comment = "change input config" }, + { argv = [ + "vt", + "run", + "test", + ], comment = "cache miss: configuration changed" }, ] [[e2e]] name = "glob input changes" steps = [ - "vt run glob-test # cache miss", - "vtt replace-file-content test.txt initial modified # modify glob input", - "vt run glob-test # cache miss: input modified", - "echo new content > new.txt # add a new .txt file", - "vt run glob-test # cache miss: input added", - "rm extra.txt # remove a .txt file", - "vt run glob-test # cache miss: input removed", + { argv = [ + "vt", + "run", + "glob-test", + ], comment = "cache miss" }, + { argv = [ + "vtt", + "replace-file-content", + "test.txt", + "initial", + "modified", + ], comment = "modify glob input" }, + { argv = [ + "vt", + "run", + "glob-test", + ], comment = "cache miss: input modified" }, + { argv = [ + "vtt", + "write-file", + "new.txt", + "new content", + ], comment = "add a new .txt file" }, + { argv = [ + "vt", + "run", + "glob-test", + ], comment = "cache miss: input added" }, + { argv = [ + "vtt", + "rm", + "extra.txt", + ], comment = "remove a .txt file" }, + { argv = [ + "vt", + "run", + "glob-test", + ], comment = "cache miss: input removed" }, ] diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/cwd changed.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/cwd changed.snap index 233816ce..e5ab7848 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/cwd changed.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/cwd changed.snap @@ -5,9 +5,9 @@ expression: e2e_outputs > vt run test # cache miss $ vtt print-file test.txt initial content -> mkdir -p subfolder +> vtt mkdir -p subfolder -> cp test.txt subfolder/test.txt +> vtt cp test.txt subfolder/test.txt > vtt replace-file-content vite-task.json '"cache": true' '"cache": true, "cwd": "subfolder"' # change cwd diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/glob input changes.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/glob input changes.snap index c4ccf04b..312c0ba6 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/glob input changes.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/glob input changes.snap @@ -10,12 +10,12 @@ glob-test > vt run glob-test # cache miss: input modified $ vtt print glob-test ○ cache miss: 'test.txt' modified, executing glob-test -> echo new content > new.txt # add a new .txt file +> vtt write-file new.txt 'new content' # add a new .txt file > vt run glob-test # cache miss: input added $ vtt print glob-test ○ cache miss: 'new.txt' added in workspace root, executing glob-test -> rm extra.txt # remove a .txt file +> vtt rm extra.txt # remove a .txt file > vt run glob-test # cache miss: input removed $ vtt print glob-test ○ cache miss: 'extra.txt' removed from workspace root, executing diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/inferred input changes.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/inferred input changes.snap index 35dd17ab..95be6571 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/inferred input changes.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-miss-reasons/snapshots/inferred input changes.snap @@ -10,12 +10,12 @@ initial content > vt run test # cache miss: input modified $ vtt print-file test.txt ○ cache miss: 'test.txt' modified, executing modified content -> rm test.txt # remove tracked input +> vtt rm test.txt # remove tracked input > vt run test # cache miss: input removed $ vtt print-file test.txt ○ cache miss: 'test.txt' removed from workspace root, executing test.txt: not found -> echo new content > test.txt # recreate previously removed file +> vtt write-file test.txt 'new content' # recreate previously removed file > vt run test # cache miss: input added $ vtt print-file test.txt ○ cache miss: 'test.txt' added in workspace root, executing diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-subcommand/snapshots.toml b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-subcommand/snapshots.toml index 556af7e5..35dba888 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-subcommand/snapshots.toml +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/cache-subcommand/snapshots.toml @@ -1,8 +1,24 @@ [[e2e]] name = "cache clean" steps = [ - "vt run cached-task # cache miss", - "vt run cached-task # cache hit", - "vt cache clean", - "vt run cached-task # cache miss after clean", + { argv = [ + "vt", + "run", + "cached-task", + ], comment = "cache miss" }, + { argv = [ + "vt", + "run", + "cached-task", + ], comment = "cache hit" }, + [ + "vt", + "cache", + "clean", + ], + { argv = [ + "vt", + "run", + "cached-task", + ], comment = "cache miss after clean" }, ] diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/colon-in-name/snapshots.toml b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/colon-in-name/snapshots.toml index 0688456b..14e43156 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/colon-in-name/snapshots.toml +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/colon-in-name/snapshots.toml @@ -2,4 +2,15 @@ [[e2e]] name = "read file with colon in name" -steps = ["vt run read_colon_in_name # cache miss", "vt run read_colon_in_name # cache hit"] +steps = [ + { argv = [ + "vt", + "run", + "read_colon_in_name", + ], comment = "cache miss" }, + { argv = [ + "vt", + "run", + "read_colon_in_name", + ], comment = "cache hit" }, +] diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/concurrent-execution/snapshots.toml b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/concurrent-execution/snapshots.toml index b9064498..f9afa72b 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/concurrent-execution/snapshots.toml +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/concurrent-execution/snapshots.toml @@ -5,7 +5,7 @@ [[e2e]] name = "independent tasks run concurrently" -steps = ["vt run -r build"] +steps = [["vt", "run", "-r", "build"]] # Both tasks use a single-command barrier (no && splitting). Task a exits with # code 1 after the barrier, task b hangs after the barrier. Since both @@ -13,17 +13,17 @@ steps = ["vt run -r build"] # The test completing without timeout proves cancellation kills b. [[e2e]] name = "failure kills concurrent tasks" -steps = ["vt run -r test"] +steps = [["vt", "run", "-r", "test"]] # Same as above but with --cache to exercise the piped stdio / fspy path # (spawn_with_tracking) instead of the inherited stdio path (spawn_inherited). [[e2e]] name = "failure kills concurrent cached tasks" -steps = ["vt run -r --cache test"] +steps = [["vt", "run", "-r", "--cache", "test"]] # Task b closes stdout/stderr after the barrier but stays alive (daemonizes). # The pipe reads EOF but the process doesn't exit. The runner must still be # able to kill it via the cancellation token + Job Object. [[e2e]] name = "failure kills daemonized concurrent tasks" -steps = ["vt run -r --cache daemon"] +steps = [["vt", "run", "-r", "--cache", "daemon"]] diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/error_cycle_dependency/snapshots.toml b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/error_cycle_dependency/snapshots.toml index 7f94968b..be23c00b 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/error_cycle_dependency/snapshots.toml +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/error_cycle_dependency/snapshots.toml @@ -2,4 +2,4 @@ [[e2e]] name = "cycle dependency error" -steps = ["vt run task-a # task-a -> task-b -> task-a cycle"] +steps = [{ argv = ["vt", "run", "task-a"], comment = "task-a -> task-b -> task-a cycle" }] diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/exit-codes/snapshots.toml b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/exit-codes/snapshots.toml index 934e4df2..d2ddafd7 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/exit-codes/snapshots.toml +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/exit-codes/snapshots.toml @@ -2,17 +2,23 @@ [[e2e]] name = "single task failure returns task exit code" -steps = ["vt run pkg-a#fail # exits with code 42"] +steps = [{ argv = ["vt", "run", "pkg-a#fail"], comment = "exits with code 42" }] [[e2e]] name = "task failure fast-fails remaining tasks" -steps = ["vt run -r fail # pkg-a fails, pkg-b is skipped"] +steps = [{ argv = ["vt", "run", "-r", "fail"], comment = "pkg-a fails, pkg-b is skipped" }] [[e2e]] name = "dependency failure fast-fails dependents" cwd = "packages/pkg-b" -steps = ["vt run -t check # pkg-a fails, pkg-b is skipped"] +steps = [{ argv = ["vt", "run", "-t", "check"], comment = "pkg-a fails, pkg-b is skipped" }] [[e2e]] name = "chained command with && stops at first failure" -steps = ["vt run pkg-a#chained # first fails with exit code 3, second should not run"] +steps = [ + { argv = [ + "vt", + "run", + "pkg-a#chained", + ], comment = "first fails with exit code 3, second should not run" }, +] diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/filter-unmatched/snapshots.toml b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/filter-unmatched/snapshots.toml index adb566d1..8c2a99b1 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/filter-unmatched/snapshots.toml +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/filter-unmatched/snapshots.toml @@ -3,29 +3,29 @@ # One filter matches, one doesn't → warning for the unmatched one, task still runs [[e2e]] name = "partial match warns for unmatched filter" -steps = ["vt run --filter @test/app --filter nonexistent build"] +steps = [["vt", "run", "--filter", "@test/app", "--filter", "nonexistent", "build"]] # Multiple unmatched alongside a match → one warning per unmatched filter [[e2e]] name = "multiple unmatched filters warn individually" -steps = ["vt run --filter @test/app --filter nope1 --filter nope2 build"] +steps = [["vt", "run", "--filter", "@test/app", "--filter", "nope1", "--filter", "nope2", "build"]] # Whitespace-split filter with one unmatched token [[e2e]] name = "whitespace split filter warns for unmatched token" -steps = ["vt run --filter '@test/app nope' build"] +steps = [["vt", "run", "--filter", "@test/app nope", "build"]] # Exclusion filter that matches nothing does NOT warn (only inclusions warn) [[e2e]] name = "unmatched exclusion filter does not warn" -steps = ["vt run --filter @test/app --filter '!nonexistent' build"] +steps = [["vt", "run", "--filter", "@test/app", "--filter", "!nonexistent", "build"]] # Glob filter that matches nothing alongside a match [[e2e]] name = "unmatched glob filter warns" -steps = ["vt run --filter @test/app --filter @nope/* build"] +steps = [["vt", "run", "--filter", "@test/app", "--filter", "@nope/*", "build"]] # Directory filter that matches nothing [[e2e]] name = "unmatched directory filter warns" -steps = ["vt run --filter @test/app --filter ./packages/nope build"] +steps = [["vt", "run", "--filter", "@test/app", "--filter", "./packages/nope", "build"]] diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/filter-unmatched/snapshots/unmatched exclusion filter does not warn.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/filter-unmatched/snapshots/unmatched exclusion filter does not warn.snap index 27100651..a76436fe 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/filter-unmatched/snapshots/unmatched exclusion filter does not warn.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/filter-unmatched/snapshots/unmatched exclusion filter does not warn.snap @@ -2,6 +2,6 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- -> vt run --filter @test/app --filter '!nonexistent' build +> vt run --filter @test/app --filter !nonexistent build ~/packages/app$ vtt print built-app built-app diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/glob-base-test/snapshots.toml b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/glob-base-test/snapshots.toml index 4e800b8c..600b1c89 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/glob-base-test/snapshots.toml +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/glob-base-test/snapshots.toml @@ -6,82 +6,82 @@ [[e2e]] name = "root glob - matches src files" steps = [ - "vt run root-glob-test", + ["vt", "run", "root-glob-test"], # Modify matched file - "vtt replace-file-content src/root.ts initial modified", + ["vtt", "replace-file-content", "src/root.ts", "initial", "modified"], # Cache miss: file matches glob - "vt run root-glob-test", + ["vt", "run", "root-glob-test"], ] [[e2e]] name = "root glob - unmatched directory" steps = [ - "vt run root-glob-test", + ["vt", "run", "root-glob-test"], # Modify file outside glob pattern - "vtt replace-file-content other/other.ts initial modified", + ["vtt", "replace-file-content", "other/other.ts", "initial", "modified"], # Cache hit: file doesn't match glob - "vt run root-glob-test", + ["vt", "run", "root-glob-test"], ] [[e2e]] name = "root glob - subpackage path unmatched by relative glob" steps = [ - "vt run root-glob-test", + ["vt", "run", "root-glob-test"], # Modify file in subpackage - relative glob src/** doesn't reach packages/sub-pkg/src/ - "vtt replace-file-content packages/sub-pkg/src/sub.ts initial modified", + ["vtt", "replace-file-content", "packages/sub-pkg/src/sub.ts", "initial", "modified"], # Cache hit: path simply doesn't match the relative glob pattern - "vt run root-glob-test", + ["vt", "run", "root-glob-test"], ] # 2. Root package with custom cwd - glob still relative to package root [[e2e]] name = "root glob with cwd - glob relative to package not cwd" steps = [ - "vt run root-glob-with-cwd", + ["vt", "run", "root-glob-with-cwd"], # Modify file - glob is src/** relative to package root - "vtt replace-file-content src/root.ts initial modified", + ["vtt", "replace-file-content", "src/root.ts", "initial", "modified"], # Cache miss: file matches glob (relative to package, not cwd) - "vt run root-glob-with-cwd", + ["vt", "run", "root-glob-with-cwd"], ] # 3. Subpackage - glob matches files in subpackage's src/ [[e2e]] name = "subpackage glob - matches own src files" steps = [ - "vt run sub-pkg#sub-glob-test", + ["vt", "run", "sub-pkg#sub-glob-test"], # Modify matched file in subpackage - "vtt replace-file-content packages/sub-pkg/src/sub.ts initial modified", + ["vtt", "replace-file-content", "packages/sub-pkg/src/sub.ts", "initial", "modified"], # Cache miss: file matches subpackage's glob - "vt run sub-pkg#sub-glob-test", + ["vt", "run", "sub-pkg#sub-glob-test"], ] [[e2e]] name = "subpackage glob - unmatched directory in subpackage" steps = [ - "vt run sub-pkg#sub-glob-test", + ["vt", "run", "sub-pkg#sub-glob-test"], # Modify file outside glob pattern - "vtt replace-file-content packages/sub-pkg/other/other.ts initial modified", + ["vtt", "replace-file-content", "packages/sub-pkg/other/other.ts", "initial", "modified"], # Cache hit: file doesn't match glob - "vt run sub-pkg#sub-glob-test", + ["vt", "run", "sub-pkg#sub-glob-test"], ] [[e2e]] name = "subpackage glob - root path unmatched by relative glob" steps = [ - "vt run sub-pkg#sub-glob-test", + ["vt", "run", "sub-pkg#sub-glob-test"], # Modify file in root - relative glob src/** is resolved from subpackage dir - "vtt replace-file-content src/root.ts initial modified", + ["vtt", "replace-file-content", "src/root.ts", "initial", "modified"], # Cache hit: path simply doesn't match the relative glob pattern - "vt run sub-pkg#sub-glob-test", + ["vt", "run", "sub-pkg#sub-glob-test"], ] # 4. Subpackage with custom cwd - glob still relative to subpackage root [[e2e]] name = "subpackage glob with cwd - glob relative to package not cwd" steps = [ - "vt run sub-pkg#sub-glob-with-cwd", + ["vt", "run", "sub-pkg#sub-glob-with-cwd"], # Modify file - glob is src/** relative to subpackage root - "vtt replace-file-content packages/sub-pkg/src/sub.ts initial modified", + ["vtt", "replace-file-content", "packages/sub-pkg/src/sub.ts", "initial", "modified"], # Cache miss: file matches glob (relative to subpackage, not cwd) - "vt run sub-pkg#sub-glob-with-cwd", + ["vt", "run", "sub-pkg#sub-glob-with-cwd"], ] diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/grouped-stdio/snapshots.toml b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/grouped-stdio/snapshots.toml index 066c3d3f..74b8e2b7 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/grouped-stdio/snapshots.toml +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/grouped-stdio/snapshots.toml @@ -11,32 +11,60 @@ [[e2e]] name = "single task, cache off, grouped output" -steps = ["vt run --log=grouped check-tty"] +steps = [["vt", "run", "--log=grouped", "check-tty"]] [[e2e]] name = "multiple tasks, cache off, grouped output" -steps = ["vt run --log=grouped -r check-tty"] +steps = [["vt", "run", "--log=grouped", "-r", "check-tty"]] [[e2e]] name = "single task, cache miss, grouped output" -steps = ["vt run --log=grouped check-tty-cached"] +steps = [["vt", "run", "--log=grouped", "check-tty-cached"]] [[e2e]] name = "multiple tasks, cache miss, grouped output" -steps = ["vt run --log=grouped -r check-tty-cached"] +steps = [["vt", "run", "--log=grouped", "-r", "check-tty-cached"]] # ─── cache hit → replayed in grouped blocks ─────────────────── [[e2e]] name = "single task, cache hit, replayed" -steps = ["vt run --log=grouped check-tty-cached", "vt run --log=grouped check-tty-cached"] +steps = [ + [ + "vt", + "run", + "--log=grouped", + "check-tty-cached", + ], + [ + "vt", + "run", + "--log=grouped", + "check-tty-cached", + ], +] [[e2e]] name = "multiple tasks, cache hit, replayed" -steps = ["vt run --log=grouped -r check-tty-cached", "vt run --log=grouped -r check-tty-cached"] +steps = [ + [ + "vt", + "run", + "--log=grouped", + "-r", + "check-tty-cached", + ], + [ + "vt", + "run", + "--log=grouped", + "-r", + "check-tty-cached", + ], +] # ─── stdin: always null ─────────────────────────────────────── [[e2e]] name = "stdin is always null" -steps = ["echo from-stdin | vt run --log=grouped read-stdin"] +steps = [["vtt", "pipe-stdin", "from-stdin", "--", "vt", "run", "--log=grouped", "read-stdin"]] diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/grouped-stdio/snapshots/stdin is always null.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/grouped-stdio/snapshots/stdin is always null.snap index 0e6c51c7..5b216f0e 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/grouped-stdio/snapshots/stdin is always null.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/grouped-stdio/snapshots/stdin is always null.snap @@ -2,5 +2,5 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- -> echo from-stdin | vt run --log=grouped read-stdin +> vtt pipe-stdin from-stdin -- vt run --log=grouped read-stdin [grouped-stdio-test#read-stdin] $ vtt read-stdin ⊘ cache disabled diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/individual-cache-for-adt-args/snapshots.toml b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/individual-cache-for-adt-args/snapshots.toml index 9f40cfd8..ddf18f0e 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/individual-cache-for-adt-args/snapshots.toml +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/individual-cache-for-adt-args/snapshots.toml @@ -3,8 +3,28 @@ [[e2e]] name = "individual cache for extra args" steps = [ - "vt run say a # cache miss", - "vt run say b # cache miss, different args", - "vt run say a # cache hit", - "vt run say b # cache hit", + { argv = [ + "vt", + "run", + "say", + "a", + ], comment = "cache miss" }, + { argv = [ + "vt", + "run", + "say", + "b", + ], comment = "cache miss, different args" }, + { argv = [ + "vt", + "run", + "say", + "a", + ], comment = "cache hit" }, + { argv = [ + "vt", + "run", + "say", + "b", + ], comment = "cache hit" }, ] diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/individual-cache-for-env/snapshots.toml b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/individual-cache-for-env/snapshots.toml index eace75ea..934d902b 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/individual-cache-for-env/snapshots.toml +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/individual-cache-for-env/snapshots.toml @@ -3,8 +3,44 @@ [[e2e]] name = "individual cache for env" steps = [ - "FOO=1 vt run hello # cache miss", - "FOO=2 vt run hello # cache miss, different env", - "FOO=1 vt run hello # cache hit", - "FOO=2 vt run hello # cache hit", + { argv = [ + "vt", + "run", + "hello", + ], envs = [ + [ + "FOO", + "1", + ], + ], comment = "cache miss" }, + { argv = [ + "vt", + "run", + "hello", + ], envs = [ + [ + "FOO", + "2", + ], + ], comment = "cache miss, different env" }, + { argv = [ + "vt", + "run", + "hello", + ], envs = [ + [ + "FOO", + "1", + ], + ], comment = "cache hit" }, + { argv = [ + "vt", + "run", + "hello", + ], envs = [ + [ + "FOO", + "2", + ], + ], comment = "cache hit" }, ] diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-cache-test/snapshots.toml b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-cache-test/snapshots.toml index 8827fd18..11c259f3 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-cache-test/snapshots.toml +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-cache-test/snapshots.toml @@ -7,31 +7,31 @@ name = "positive globs only - cache hit on second run" steps = [ # First run - cache miss - "vt run positive-globs-only", + ["vt", "run", "positive-globs-only"], # Second run - cache hit - "vt run positive-globs-only", + ["vt", "run", "positive-globs-only"], ] [[e2e]] name = "positive globs only - miss on matched file change" steps = [ # Initial run - "vt run positive-globs-only", + ["vt", "run", "positive-globs-only"], # Modify a file that matches the glob - "vtt replace-file-content src/main.ts initial modified", + ["vtt", "replace-file-content", "src/main.ts", "initial", "modified"], # Cache miss: matched file changed - "vt run positive-globs-only", + ["vt", "run", "positive-globs-only"], ] [[e2e]] name = "positive globs only - hit on unmatched file change" steps = [ # Initial run - "vt run positive-globs-only", + ["vt", "run", "positive-globs-only"], # Modify a file that does NOT match the glob (test/ is outside src/) - "vtt replace-file-content test/main.test.ts outside modified", + ["vtt", "replace-file-content", "test/main.test.ts", "outside", "modified"], # Cache hit: file not in input - "vt run positive-globs-only", + ["vt", "run", "positive-globs-only"], ] # 1b. Positive globs reads unmatched file: input: ["src/main.ts"], command reads src/utils.ts too @@ -41,11 +41,11 @@ steps = [ name = "positive globs - hit on read but unmatched file" steps = [ # Initial run - reads both src/main.ts and src/utils.ts - "vt run positive-globs-reads-unmatched", + ["vt", "run", "positive-globs-reads-unmatched"], # Modify utils.ts - read by command but NOT in glob - "vtt replace-file-content src/utils.ts initial modified", + ["vtt", "replace-file-content", "src/utils.ts", "initial", "modified"], # Cache hit: file was read but not matched by glob, inference is off - "vt run positive-globs-reads-unmatched", + ["vt", "run", "positive-globs-reads-unmatched"], ] # 2. Positive + negative globs: input: ["src/**", "!src/**/*.test.ts"] @@ -55,22 +55,22 @@ steps = [ name = "positive negative globs - miss on non-excluded file" steps = [ # Initial run - "vt run positive-negative-globs", + ["vt", "run", "positive-negative-globs"], # Modify a file that matches positive but NOT negative - "vtt replace-file-content src/main.ts initial modified", + ["vtt", "replace-file-content", "src/main.ts", "initial", "modified"], # Cache miss: file changed - "vt run positive-negative-globs", + ["vt", "run", "positive-negative-globs"], ] [[e2e]] name = "positive negative globs - hit on excluded file" steps = [ # Initial run - "vt run positive-negative-globs", + ["vt", "run", "positive-negative-globs"], # Modify a file that matches the negative glob (excluded) - "vtt replace-file-content src/main.test.ts main modified", + ["vtt", "replace-file-content", "src/main.test.ts", "main", "modified"], # Cache hit: file excluded by negative glob - "vt run positive-negative-globs", + ["vt", "run", "positive-negative-globs"], ] # 3. Auto only: input: [{ "auto": true }] @@ -80,22 +80,22 @@ steps = [ name = "auto only - miss on inferred file change" steps = [ # Initial run - reads src/main.ts - "vt run auto-only", + ["vt", "run", "auto-only"], # Modify the file that was read - "vtt replace-file-content src/main.ts initial modified", + ["vtt", "replace-file-content", "src/main.ts", "initial", "modified"], # Cache miss: inferred input changed - "vt run auto-only", + ["vt", "run", "auto-only"], ] [[e2e]] name = "auto only - hit on non-inferred file change" steps = [ # Initial run - reads src/main.ts (NOT utils.ts) - "vt run auto-only", + ["vt", "run", "auto-only"], # Modify a file that was NOT read by the command - "vtt replace-file-content src/utils.ts initial modified", + ["vtt", "replace-file-content", "src/utils.ts", "initial", "modified"], # Cache hit: file not in inferred input - "vt run auto-only", + ["vt", "run", "auto-only"], ] # 4. Auto + negative: input: [{ "auto": true }, "!dist/**"] @@ -105,22 +105,22 @@ steps = [ name = "auto with negative - hit on excluded inferred file" steps = [ # Initial run - reads both src/main.ts and dist/output.js - "vt run auto-with-negative", + ["vt", "run", "auto-with-negative"], # Modify file in excluded directory (dist/) - "vtt replace-file-content dist/output.js initial modified", + ["vtt", "replace-file-content", "dist/output.js", "initial", "modified"], # Cache hit: dist/ is excluded by negative glob - "vt run auto-with-negative", + ["vt", "run", "auto-with-negative"], ] [[e2e]] name = "auto with negative - miss on non-excluded inferred file" steps = [ # Initial run - "vt run auto-with-negative", + ["vt", "run", "auto-with-negative"], # Modify file NOT in excluded directory - "vtt replace-file-content src/main.ts initial modified", + ["vtt", "replace-file-content", "src/main.ts", "initial", "modified"], # Cache miss: inferred input changed - "vt run auto-with-negative", + ["vt", "run", "auto-with-negative"], ] # 5. Positive + auto + negative: input: ["package.json", { "auto": true }, "!src/**/*.test.ts"] @@ -130,33 +130,33 @@ steps = [ name = "positive auto negative - miss on explicit glob file" steps = [ # Initial run - "vt run positive-auto-negative", + ["vt", "run", "positive-auto-negative"], # Modify explicit input file - "vtt replace-file-content package.json inputs-cache-test modified-pkg", + ["vtt", "replace-file-content", "package.json", "inputs-cache-test", "modified-pkg"], # Cache miss: explicit input changed - "vt run positive-auto-negative", + ["vt", "run", "positive-auto-negative"], ] [[e2e]] name = "positive auto negative - miss on inferred file" steps = [ # Initial run - "vt run positive-auto-negative", + ["vt", "run", "positive-auto-negative"], # Modify inferred input file (read by command) - "vtt replace-file-content src/main.ts initial modified", + ["vtt", "replace-file-content", "src/main.ts", "initial", "modified"], # Cache miss: inferred input changed - "vt run positive-auto-negative", + ["vt", "run", "positive-auto-negative"], ] [[e2e]] name = "positive auto negative - hit on excluded file" steps = [ # Initial run - "vt run positive-auto-negative", + ["vt", "run", "positive-auto-negative"], # Modify file excluded by negative glob - "vtt replace-file-content src/main.test.ts main modified", + ["vtt", "replace-file-content", "src/main.test.ts", "main", "modified"], # Cache hit: file excluded by negative glob - "vt run positive-auto-negative", + ["vt", "run", "positive-auto-negative"], ] # 6. Empty input: input: [] @@ -166,22 +166,36 @@ steps = [ name = "empty input - hit despite file changes" steps = [ # Initial run - "vt run empty-inputs", + ["vt", "run", "empty-inputs"], # Modify any file - should NOT affect cache - "vtt replace-file-content src/main.ts initial modified", + ["vtt", "replace-file-content", "src/main.ts", "initial", "modified"], # Cache hit: no input configured - "vt run empty-inputs", + ["vt", "run", "empty-inputs"], ] [[e2e]] name = "empty input - miss on command change" steps = [ # Initial run - "vt run empty-inputs", + [ + "vt", + "run", + "empty-inputs", + ], # Change the command - "vtt replace-file-content vite-task.json 'vtt print-file ./src/main.ts' 'vtt print-file src/utils.ts'", + [ + "vtt", + "replace-file-content", + "vite-task.json", + "vtt print-file ./src/main.ts", + "vtt print-file src/utils.ts", + ], # Cache miss: command changed - "vt run empty-inputs", + [ + "vt", + "run", + "empty-inputs", + ], ] # 7. FSPY environment variable @@ -191,14 +205,14 @@ steps = [ name = "fspy env - set when auto inference enabled" steps = [ # Run task with auto inference - should see FSPY=1 - "vt run check-fspy-env-with-auto", + ["vt", "run", "check-fspy-env-with-auto"], ] [[e2e]] name = "fspy env - not set when auto inference disabled" steps = [ # Run task without auto inference - should see (undefined) - "vt run check-fspy-env-without-auto", + ["vt", "run", "check-fspy-env-without-auto"], ] # 8. Trailing slash input: input: ["src/"] @@ -208,28 +222,28 @@ steps = [ [[e2e]] name = "folder slash input - miss on direct and nested file changes" steps = [ - "vt run folder-slash-input", + ["vt", "run", "folder-slash-input"], # Modify a direct file in src/ - "vtt replace-file-content src/main.ts initial modified", + ["vtt", "replace-file-content", "src/main.ts", "initial", "modified"], # Cache miss: direct file changed - "vt run folder-slash-input", + ["vt", "run", "folder-slash-input"], # Reset and run again to re-establish cache - "vtt replace-file-content src/main.ts modified initial", - "vt run folder-slash-input", + ["vtt", "replace-file-content", "src/main.ts", "modified", "initial"], + ["vt", "run", "folder-slash-input"], # Modify a nested file in src/sub/ - "vtt replace-file-content src/sub/nested.ts initial modified", + ["vtt", "replace-file-content", "src/sub/nested.ts", "initial", "modified"], # Cache miss: nested file changed - "vt run folder-slash-input", + ["vt", "run", "folder-slash-input"], ] [[e2e]] name = "folder slash input - hit on file outside directory" steps = [ - "vt run folder-slash-input", + ["vt", "run", "folder-slash-input"], # Modify a file outside src/ - "vtt replace-file-content test/main.test.ts outside modified", + ["vtt", "replace-file-content", "test/main.test.ts", "outside", "modified"], # Cache hit: file not under src/ - "vt run folder-slash-input", + ["vt", "run", "folder-slash-input"], ] # 9. Folder path as input: input: ["src"] @@ -238,13 +252,13 @@ steps = [ [[e2e]] name = "folder input - hit despite file changes and folder deletion" steps = [ - "vt run folder-input", + ["vt", "run", "folder-input"], # Modify a file inside the folder - "vtt replace-file-content src/main.ts initial modified", + ["vtt", "replace-file-content", "src/main.ts", "initial", "modified"], # Cache hit: "src" matches the directory itself, not files inside it - "vt run folder-input", + ["vt", "run", "folder-input"], # Delete the entire folder - "rm -rf src", + ["vtt", "rm", "-rf", "src"], # Cache hit: folder removal doesn't affect fingerprint - "vt run folder-input", + ["vt", "run", "folder-input"], ] diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-cache-test/snapshots/folder input - hit despite file changes and folder deletion.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-cache-test/snapshots/folder input - hit despite file changes and folder deletion.snap index 7e376322..bdb4ce8d 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-cache-test/snapshots/folder input - hit despite file changes and folder deletion.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-cache-test/snapshots/folder input - hit despite file changes and folder deletion.snap @@ -13,7 +13,7 @@ export const main = 'initial'; --- vt run: cache hit. -> rm -rf src +> vtt rm -rf src > vt run folder-input $ vtt print-file src/main.ts ◉ cache hit, replaying diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-glob-meta-in-path/snapshots.toml b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-glob-meta-in-path/snapshots.toml index 3a63506b..26722e58 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-glob-meta-in-path/snapshots.toml +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-glob-meta-in-path/snapshots.toml @@ -5,8 +5,26 @@ [[e2e]] name = "cache hit then miss on file change" steps = [ - "vt run [lib]#build", - "vt run [lib]#build", - "vtt replace-file-content packages/[lib]/src/main.ts initial modified", - "vt run [lib]#build", + [ + "vt", + "run", + "[lib]#build", + ], + [ + "vt", + "run", + "[lib]#build", + ], + [ + "vtt", + "replace-file-content", + "packages/[lib]/src/main.ts", + "initial", + "modified", + ], + [ + "vt", + "run", + "[lib]#build", + ], ] diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-negative-glob-subpackage/snapshots.toml b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-negative-glob-subpackage/snapshots.toml index dc131685..463c5e16 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-negative-glob-subpackage/snapshots.toml +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-negative-glob-subpackage/snapshots.toml @@ -10,22 +10,22 @@ name = "subpackage auto with negative - hit on excluded inferred file" steps = [ # First run - reads both src/main.ts and dist/output.js - "vt run sub-pkg#auto-with-negative", + ["vt", "run", "sub-pkg#auto-with-negative"], # Modify file in excluded directory (dist/) - "vtt replace-file-content packages/sub-pkg/dist/output.js initial modified", + ["vtt", "replace-file-content", "packages/sub-pkg/dist/output.js", "initial", "modified"], # Cache hit: dist/ is excluded by negative glob - "vt run sub-pkg#auto-with-negative", + ["vt", "run", "sub-pkg#auto-with-negative"], ] [[e2e]] name = "subpackage auto with negative - miss on non-excluded inferred file" steps = [ # First run - "vt run sub-pkg#auto-with-negative", + ["vt", "run", "sub-pkg#auto-with-negative"], # Modify file NOT in excluded directory - "vtt replace-file-content packages/sub-pkg/src/main.ts initial modified", + ["vtt", "replace-file-content", "packages/sub-pkg/src/main.ts", "initial", "modified"], # Cache miss: inferred input changed - "vt run sub-pkg#auto-with-negative", + ["vt", "run", "sub-pkg#auto-with-negative"], ] # .. prefix positive globs: input: ["../shared/src/**"] @@ -34,21 +34,21 @@ steps = [ [[e2e]] name = "dotdot positive glob - miss on sibling file change" steps = [ - "vt run sub-pkg#dotdot-positive", + ["vt", "run", "sub-pkg#dotdot-positive"], # Modify a file that matches ../shared/src/** - "vtt replace-file-content packages/shared/src/utils.ts initial modified", + ["vtt", "replace-file-content", "packages/shared/src/utils.ts", "initial", "modified"], # Cache miss: matched file changed - "vt run sub-pkg#dotdot-positive", + ["vt", "run", "sub-pkg#dotdot-positive"], ] [[e2e]] name = "dotdot positive glob - hit on unmatched file change" steps = [ - "vt run sub-pkg#dotdot-positive", + ["vt", "run", "sub-pkg#dotdot-positive"], # Modify a file NOT matched by ../shared/src/** - "vtt replace-file-content packages/shared/dist/output.js initial modified", + ["vtt", "replace-file-content", "packages/shared/dist/output.js", "initial", "modified"], # Cache hit: file not in input - "vt run sub-pkg#dotdot-positive", + ["vt", "run", "sub-pkg#dotdot-positive"], ] # .. prefix positive + negative globs: input: ["../shared/**", "!../shared/dist/**"] @@ -57,21 +57,21 @@ steps = [ [[e2e]] name = "dotdot positive negative - miss on non-excluded sibling file" steps = [ - "vt run sub-pkg#dotdot-positive-negative", + ["vt", "run", "sub-pkg#dotdot-positive-negative"], # Modify file matching positive but NOT negative - "vtt replace-file-content packages/shared/src/utils.ts initial modified", + ["vtt", "replace-file-content", "packages/shared/src/utils.ts", "initial", "modified"], # Cache miss: file changed - "vt run sub-pkg#dotdot-positive-negative", + ["vt", "run", "sub-pkg#dotdot-positive-negative"], ] [[e2e]] name = "dotdot positive negative - hit on excluded sibling file" steps = [ - "vt run sub-pkg#dotdot-positive-negative", + ["vt", "run", "sub-pkg#dotdot-positive-negative"], # Modify file in excluded sibling dist/ - "vtt replace-file-content packages/shared/dist/output.js initial modified", + ["vtt", "replace-file-content", "packages/shared/dist/output.js", "initial", "modified"], # Cache hit: excluded by !../shared/dist/** - "vt run sub-pkg#dotdot-positive-negative", + ["vt", "run", "sub-pkg#dotdot-positive-negative"], ] # .. prefix auto + negative: input: [{ "auto": true }, "!../shared/dist/**"] @@ -80,19 +80,19 @@ steps = [ [[e2e]] name = "dotdot auto negative - hit on excluded sibling inferred file" steps = [ - "vt run sub-pkg#dotdot-auto-negative", + ["vt", "run", "sub-pkg#dotdot-auto-negative"], # Modify file in excluded sibling dist/ - "vtt replace-file-content packages/shared/dist/output.js initial modified", + ["vtt", "replace-file-content", "packages/shared/dist/output.js", "initial", "modified"], # Cache hit: excluded by !../shared/dist/** - "vt run sub-pkg#dotdot-auto-negative", + ["vt", "run", "sub-pkg#dotdot-auto-negative"], ] [[e2e]] name = "dotdot auto negative - miss on non-excluded sibling inferred file" steps = [ - "vt run sub-pkg#dotdot-auto-negative", + ["vt", "run", "sub-pkg#dotdot-auto-negative"], # Modify non-excluded sibling file - "vtt replace-file-content packages/shared/src/utils.ts initial modified", + ["vtt", "replace-file-content", "packages/shared/src/utils.ts", "initial", "modified"], # Cache miss: inferred input changed - "vt run sub-pkg#dotdot-auto-negative", + ["vt", "run", "sub-pkg#dotdot-auto-negative"], ] diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-read-write-not-cached/snapshots.toml b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-read-write-not-cached/snapshots.toml index 9db4c0dd..bb40eefd 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-read-write-not-cached/snapshots.toml +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/input-read-write-not-cached/snapshots.toml @@ -5,21 +5,21 @@ [[e2e]] name = "single read-write task shows not cached message" cwd = "packages/rw-pkg" -steps = ["vt run task", "vt run task"] +steps = [["vt", "run", "task"], ["vt", "run", "task"]] # Multi-task (recursive): compact summary shows stats + InputModified notice [[e2e]] name = "multi task with read-write shows not cached in summary" -steps = ["vt run -r task", "vt run -r task"] +steps = [["vt", "run", "-r", "task"], ["vt", "run", "-r", "task"]] # Verbose: full summary shows the overlapping path [[e2e]] name = "verbose read-write task shows path in full summary" cwd = "packages/rw-pkg" -steps = ["vt run -v task"] +steps = [["vt", "run", "-v", "task"]] # Single O_RDWR open (touch-file) is also detected as read-write overlap [[e2e]] name = "single O_RDWR open is not cached" cwd = "packages/touch-pkg" -steps = ["vt run task", "vt run task"] +steps = [["vt", "run", "task"], ["vt", "run", "task"]] diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/interleaved-stdio/snapshots.toml b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/interleaved-stdio/snapshots.toml index 2bc3ee00..60550bea 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/interleaved-stdio/snapshots.toml +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/interleaved-stdio/snapshots.toml @@ -13,40 +13,40 @@ [[e2e]] name = "single task, cache off, inherits stdio" -steps = ["vt run check-tty"] +steps = [["vt", "run", "check-tty"]] [[e2e]] name = "multiple tasks, cache off, inherit stdio" -steps = ["vt run -r check-tty"] +steps = [["vt", "run", "-r", "check-tty"]] # ─── stdout/stderr: cache on, miss → piped (not-tty) ──────────── [[e2e]] name = "single task, cache miss, piped stdio" -steps = ["vt run check-tty-cached"] +steps = [["vt", "run", "check-tty-cached"]] [[e2e]] name = "multiple tasks, cache miss, piped stdio" -steps = ["vt run -r check-tty-cached"] +steps = [["vt", "run", "-r", "check-tty-cached"]] # ─── stdout/stderr: cache on, hit → replayed ──────────────────── [[e2e]] name = "single task, cache hit, replayed" -steps = ["vt run check-tty-cached", "vt run check-tty-cached"] +steps = [["vt", "run", "check-tty-cached"], ["vt", "run", "check-tty-cached"]] [[e2e]] name = "multiple tasks, cache hit, replayed" -steps = ["vt run -r check-tty-cached", "vt run -r check-tty-cached"] +steps = [["vt", "run", "-r", "check-tty-cached"], ["vt", "run", "-r", "check-tty-cached"]] # ─── stdin: cache off → inherited ─────────────────────────────── [[e2e]] name = "cache off inherits stdin" -steps = ["echo from-stdin | vt run read-stdin"] +steps = [["vtt", "pipe-stdin", "from-stdin", "--", "vt", "run", "read-stdin"]] # ─── stdin: cache on → null ───────────────────────────────────── [[e2e]] name = "cache on gets null stdin" -steps = ["echo from-stdin | vt run read-stdin-cached"] +steps = [["vtt", "pipe-stdin", "from-stdin", "--", "vt", "run", "read-stdin-cached"]] diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/interleaved-stdio/snapshots/cache off inherits stdin.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/interleaved-stdio/snapshots/cache off inherits stdin.snap index fa7fabc7..ab418453 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/interleaved-stdio/snapshots/cache off inherits stdin.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/interleaved-stdio/snapshots/cache off inherits stdin.snap @@ -2,6 +2,6 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- -> echo from-stdin | vt run read-stdin +> vtt pipe-stdin from-stdin -- vt run read-stdin $ vtt read-stdin ⊘ cache disabled from-stdin diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/interleaved-stdio/snapshots/cache on gets null stdin.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/interleaved-stdio/snapshots/cache on gets null stdin.snap index 1e14aed6..3d895dce 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/interleaved-stdio/snapshots/cache on gets null stdin.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/interleaved-stdio/snapshots/cache on gets null stdin.snap @@ -2,5 +2,5 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- -> echo from-stdin | vt run read-stdin-cached +> vtt pipe-stdin from-stdin -- vt run read-stdin-cached $ vtt read-stdin diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/labeled-stdio/snapshots.toml b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/labeled-stdio/snapshots.toml index 5524d8f7..86730c41 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/labeled-stdio/snapshots.toml +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/labeled-stdio/snapshots.toml @@ -11,32 +11,60 @@ [[e2e]] name = "single task, cache off, piped stdio" -steps = ["vt run --log=labeled check-tty"] +steps = [["vt", "run", "--log=labeled", "check-tty"]] [[e2e]] name = "multiple tasks, cache off, piped stdio" -steps = ["vt run --log=labeled -r check-tty"] +steps = [["vt", "run", "--log=labeled", "-r", "check-tty"]] [[e2e]] name = "single task, cache miss, piped stdio" -steps = ["vt run --log=labeled check-tty-cached"] +steps = [["vt", "run", "--log=labeled", "check-tty-cached"]] [[e2e]] name = "multiple tasks, cache miss, piped stdio" -steps = ["vt run --log=labeled -r check-tty-cached"] +steps = [["vt", "run", "--log=labeled", "-r", "check-tty-cached"]] # ─── cache hit → replayed with labels ───────────────────────── [[e2e]] name = "single task, cache hit, replayed" -steps = ["vt run --log=labeled check-tty-cached", "vt run --log=labeled check-tty-cached"] +steps = [ + [ + "vt", + "run", + "--log=labeled", + "check-tty-cached", + ], + [ + "vt", + "run", + "--log=labeled", + "check-tty-cached", + ], +] [[e2e]] name = "multiple tasks, cache hit, replayed" -steps = ["vt run --log=labeled -r check-tty-cached", "vt run --log=labeled -r check-tty-cached"] +steps = [ + [ + "vt", + "run", + "--log=labeled", + "-r", + "check-tty-cached", + ], + [ + "vt", + "run", + "--log=labeled", + "-r", + "check-tty-cached", + ], +] # ─── stdin: always null ─────────────────────────────────────── [[e2e]] name = "stdin is always null" -steps = ["echo from-stdin | vt run --log=labeled read-stdin"] +steps = [["vtt", "pipe-stdin", "from-stdin", "--", "vt", "run", "--log=labeled", "read-stdin"]] diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/labeled-stdio/snapshots/stdin is always null.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/labeled-stdio/snapshots/stdin is always null.snap index 49e243bb..0c3b39e7 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/labeled-stdio/snapshots/stdin is always null.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/labeled-stdio/snapshots/stdin is always null.snap @@ -2,5 +2,5 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- -> echo from-stdin | vt run --log=labeled read-stdin +> vtt pipe-stdin from-stdin -- vt run --log=labeled read-stdin [labeled-stdio-test#read-stdin] $ vtt read-stdin ⊘ cache disabled diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/pass-args-to-task/snapshots.toml b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/pass-args-to-task/snapshots.toml index 1f314994..8353e860 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/pass-args-to-task/snapshots.toml +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/pass-args-to-task/snapshots.toml @@ -4,8 +4,8 @@ [[e2e]] name = "pass args to task" steps = [ - "vt run echo --help", # Should just print `help` instead of Vite task's help - "vt run echo --version", # Should just print `version` instead of Vite task's version - "vt run echo -v", # Should just print `-v` - "vt run echo -a", # Should just print `-a` + ["vt", "run", "echo", "--help"], # Should just print `help` instead of Vite task's help + ["vt", "run", "echo", "--version"], # Should just print `version` instead of Vite task's version + ["vt", "run", "echo", "-v"], # Should just print `-v` + ["vt", "run", "echo", "-a"], # Should just print `-a` ] diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/replay-logs-chronological-order/snapshots.toml b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/replay-logs-chronological-order/snapshots.toml index 6a0c573a..f3ee22aa 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/replay-logs-chronological-order/snapshots.toml +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/replay-logs-chronological-order/snapshots.toml @@ -2,4 +2,20 @@ [[e2e]] name = "replay logs chronological order" -steps = ["vt run build # cache miss", "vt run build # cache hit", "vt run build # cache hit"] +steps = [ + { argv = [ + "vt", + "run", + "build", + ], comment = "cache miss" }, + { argv = [ + "vt", + "run", + "build", + ], comment = "cache hit" }, + { argv = [ + "vt", + "run", + "build", + ], comment = "cache hit" }, +] diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/shared-caching-input/snapshots.toml b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/shared-caching-input/snapshots.toml index 7070bf80..b554694b 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/shared-caching-input/snapshots.toml +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/shared-caching-input/snapshots.toml @@ -3,9 +3,31 @@ [[e2e]] name = "shared caching input" steps = [ - "vt run script1 # cache miss", - "vt run script2 # cache hit, same command as script1", - "vtt replace-file-content foo.txt initial modified # modify shared input", - "vt run script2 # cache miss, input changed", - "vt run script1 # cache hit, script2 already warmed cache", + { argv = [ + "vt", + "run", + "script1", + ], comment = "cache miss" }, + { argv = [ + "vt", + "run", + "script2", + ], comment = "cache hit, same command as script1" }, + { argv = [ + "vtt", + "replace-file-content", + "foo.txt", + "initial", + "modified", + ], comment = "modify shared input" }, + { argv = [ + "vt", + "run", + "script2", + ], comment = "cache miss, input changed" }, + { argv = [ + "vt", + "run", + "script1", + ], comment = "cache hit, script2 already warmed cache" }, ] diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/signal-exit/snapshots.toml b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/signal-exit/snapshots.toml index bb233b18..b0917e7b 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/signal-exit/snapshots.toml +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/signal-exit/snapshots.toml @@ -4,4 +4,4 @@ [[e2e]] name = "signal terminated task returns non-zero exit code" platform = "unix" -steps = ["vt run abort # SIGABRT -> exit code 134"] +steps = [{ argv = ["vt", "run", "abort"], comment = "SIGABRT -> exit code 134" }] diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/summary-output/snapshots.toml b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/summary-output/snapshots.toml index 097a4d19..c69e0260 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/summary-output/snapshots.toml +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/summary-output/snapshots.toml @@ -4,58 +4,113 @@ [[e2e]] name = "single task cache miss shows no summary" cwd = "packages/a" -steps = ["vt run build"] +steps = [["vt", "run", "build"]] # Single task, cache hit → compact one-liner [[e2e]] name = "single task cache hit shows compact summary" cwd = "packages/a" steps = [ - "vt run build # first run, cache miss", - "vt run build # second run, cache hit → compact summary", + { argv = [ + "vt", + "run", + "build", + ], comment = "first run, cache miss" }, + { argv = [ + "vt", + "run", + "build", + ], comment = "second run, cache hit → compact summary" }, ] # Multi-task (recursive), all cache miss → compact summary with 0 hits [[e2e]] name = "multi task all cache miss shows compact summary" -steps = ["vt run -r build"] +steps = [["vt", "run", "-r", "build"]] # Multi-task (recursive), some cache hits → compact summary with hit count [[e2e]] name = "multi task with cache hits shows compact summary" -steps = ["vt run -r build # first run, all miss", "vt run -r build # second run, all hit"] +steps = [ + { argv = [ + "vt", + "run", + "-r", + "build", + ], comment = "first run, all miss" }, + { argv = [ + "vt", + "run", + "-r", + "build", + ], comment = "second run, all hit" }, +] # Single task with --verbose → full detailed summary [[e2e]] name = "single task verbose shows full summary" cwd = "packages/a" -steps = ["vt run -v build"] +steps = [["vt", "run", "-v", "build"]] # Multi-task with --verbose → full detailed summary [[e2e]] name = "multi task verbose shows full summary" -steps = ["vt run -r -v build"] +steps = [["vt", "run", "-r", "-v", "build"]] # Multi-task with --verbose after cache hits [[e2e]] name = "multi task verbose with cache hits shows full summary" steps = [ - "vt run -r build # first run, populate cache", - "vt run -r -v build # second run, verbose with cache hits", + { argv = [ + "vt", + "run", + "-r", + "build", + ], comment = "first run, populate cache" }, + { argv = [ + "vt", + "run", + "-r", + "-v", + "build", + ], comment = "second run, verbose with cache hits" }, ] # --last-details with no previous run [[e2e]] name = "last details with no previous run shows error" -steps = ["vt run --last-details"] +steps = [["vt", "run", "--last-details"]] # --last-details after a run shows saved summary [[e2e]] name = "last details after run shows saved summary" cwd = "packages/a" -steps = ["vt run build # populate summary file", "vt run --last-details # display saved summary"] +steps = [ + { argv = [ + "vt", + "run", + "build", + ], comment = "populate summary file" }, + { argv = [ + "vt", + "run", + "--last-details", + ], comment = "display saved summary" }, +] # --last-details after a multi-task run [[e2e]] name = "last details after multi task run shows saved summary" -steps = ["vt run -r build # populate summary file", "vt run --last-details # display saved summary"] +steps = [ + { argv = [ + "vt", + "run", + "-r", + "build", + ], comment = "populate summary file" }, + { argv = [ + "vt", + "run", + "--last-details", + ], comment = "display saved summary" }, +] diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-list/snapshots.toml b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-list/snapshots.toml index d8aeff3a..5de2b6e6 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-list/snapshots.toml +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-list/snapshots.toml @@ -1,16 +1,20 @@ [[e2e]] name = "list tasks from package dir" cwd = "packages/app" -steps = ["echo '' | vt run"] +steps = [["vtt", "pipe-stdin", "--", "vt", "run"]] [[e2e]] name = "list tasks from workspace root" -steps = ["echo '' | vt run"] +steps = [["vtt", "pipe-stdin", "--", "vt", "run"]] [[e2e]] name = "vt run in script" steps = [ - { command = "vt run list-tasks", interactions = [ + { argv = [ + "vt", + "run", + "list-tasks", + ], interactions = [ { "expect-milestone" = "task-select::0" }, { "write-key" = "enter" }, ] }, diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-list/snapshots/list tasks from package dir.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-list/snapshots/list tasks from package dir.snap index c1b7e917..17a559df 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-list/snapshots/list tasks from package dir.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-list/snapshots/list tasks from package dir.snap @@ -4,7 +4,7 @@ expression: e2e_outputs info: cwd: packages/app --- -> echo '' | vt run +> vtt pipe-stdin -- vt run build: echo build app lint: echo lint app test: echo test app diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-list/snapshots/list tasks from workspace root.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-list/snapshots/list tasks from workspace root.snap index 5ba0cb61..a366311a 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-list/snapshots/list tasks from workspace root.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-list/snapshots/list tasks from workspace root.snap @@ -2,7 +2,7 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- -> echo '' | vt run +> vtt pipe-stdin -- vt run hello: echo hello from root list-tasks: vt run app#build: echo build app diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-no-trailing-newline/snapshots.toml b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-no-trailing-newline/snapshots.toml index b85139ae..26c9ff43 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-no-trailing-newline/snapshots.toml +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-no-trailing-newline/snapshots.toml @@ -2,4 +2,4 @@ [[e2e]] name = "no trailing newline" -steps = ["vt run hello # runs echo -n hello"] +steps = [{ argv = ["vt", "run", "hello"], comment = "runs echo -n hello" }] diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-select-truncate/snapshots.toml b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-select-truncate/snapshots.toml index c7dc1647..e2f84635 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-select-truncate/snapshots.toml +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-select-truncate/snapshots.toml @@ -3,7 +3,10 @@ name = "interactive long command truncated" cwd = "packages/app" steps = [ - { command = "vt run", interactions = [ + { argv = [ + "vt", + "run", + ], interactions = [ { "expect-milestone" = "task-select::0" }, { "write-key" = "down" }, { "expect-milestone" = "task-select::1" }, diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-select/snapshots.toml b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-select/snapshots.toml index 9f9562da..3400050e 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-select/snapshots.toml +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-select/snapshots.toml @@ -1,29 +1,32 @@ # Non-interactive: list all tasks (piped stdin forces non-interactive mode) [[e2e]] name = "non-interactive list tasks" -steps = ["echo '' | vt run"] +steps = [["vtt", "pipe-stdin", "--", "vt", "run"]] # Non-interactive: typo triggers "did you mean" [[e2e]] name = "non-interactive did you mean" -steps = ["echo '' | vt run buid"] +steps = [["vtt", "pipe-stdin", "--", "vt", "run", "buid"]] # Non-interactive: typo with no fuzzy matches hides "did you mean" [[e2e]] name = "non-interactive no suggestions" -steps = ["echo '' | vt run zzzzz"] +steps = [["vtt", "pipe-stdin", "--", "vt", "run", "zzzzz"]] # Non-interactive: typo with -r flag errors (not cwd_only) [[e2e]] name = "non-interactive recursive typo errors" -steps = ["echo '' | vt run -r buid"] +steps = [["vtt", "pipe-stdin", "--", "vt", "run", "-r", "buid"]] # Interactive: navigate down and select second task [[e2e]] name = "interactive select task" cwd = "packages/app" steps = [ - { command = "vt run", interactions = [ + { argv = [ + "vt", + "run", + ], interactions = [ { "expect-milestone" = "task-select::0" }, { "write-key" = "down" }, { "expect-milestone" = "task-select::1" }, @@ -36,7 +39,11 @@ steps = [ name = "interactive select with typo" cwd = "packages/app" steps = [ - { command = "vt run buid", interactions = [ + { argv = [ + "vt", + "run", + "buid", + ], interactions = [ { "expect-milestone" = "task-select:buid:0" }, { "write-key" = "enter" }, ] }, @@ -47,7 +54,10 @@ steps = [ name = "interactive search then select" cwd = "packages/app" steps = [ - { command = "vt run", interactions = [ + { argv = [ + "vt", + "run", + ], interactions = [ { "expect-milestone" = "task-select::0" }, { "write" = "lin" }, { "expect-milestone" = "task-select:lin:0" }, @@ -60,7 +70,10 @@ steps = [ name = "interactive escape clears query" cwd = "packages/app" steps = [ - { command = "vt run", interactions = [ + { argv = [ + "vt", + "run", + ], interactions = [ { "expect-milestone" = "task-select::0" }, { "write" = "lin" }, { "expect-milestone" = "task-select:lin:0" }, @@ -74,20 +87,23 @@ steps = [ [[e2e]] name = "recursive without task errors" cwd = "packages/app" -steps = ["vt run -r"] +steps = [["vt", "run", "-r"]] # -t flag + typo errors (not cwd_only) [[e2e]] name = "transitive typo errors" cwd = "packages/app" -steps = ["vt run -t buid"] +steps = [["vt", "run", "-t", "buid"]] # Interactive: scroll down past visible page, then select a task beyond the initial viewport [[e2e]] name = "interactive scroll long list" cwd = "packages/app" steps = [ - { command = "vt run", interactions = [ + { argv = [ + "vt", + "run", + ], interactions = [ { "expect-milestone" = "task-select::0" }, # Navigate down to index 8 (past page_size=8, triggering scroll) { "write-key" = "down" }, { "write-key" = "down" }, @@ -115,14 +131,17 @@ steps = [ [[e2e]] name = "non-interactive list tasks from lib" cwd = "packages/lib" -steps = ["echo '' | vt run"] +steps = [["vtt", "pipe-stdin", "--", "vt", "run"]] # Interactive: select from lib package (first item is lib's task) [[e2e]] name = "interactive select task from lib" cwd = "packages/lib" steps = [ - { command = "vt run", interactions = [ + { argv = [ + "vt", + "run", + ], interactions = [ { "expect-milestone" = "task-select::0" }, { "write-key" = "enter" }, ] }, @@ -133,7 +152,10 @@ steps = [ name = "interactive search other package task" cwd = "packages/app" steps = [ - { command = "vt run", interactions = [ + { argv = [ + "vt", + "run", + ], interactions = [ { "expect-milestone" = "task-select::0" }, { "write" = "typec" }, { "expect-milestone" = "task-select:typec:0" }, @@ -146,7 +168,10 @@ steps = [ name = "interactive search with hash skips reorder" cwd = "packages/app" steps = [ - { command = "vt run", interactions = [ + { argv = [ + "vt", + "run", + ], interactions = [ { "expect-milestone" = "task-select::0" }, { "write" = "lib#" }, { "expect-milestone" = "task-select:lib#:0" }, @@ -159,7 +184,10 @@ steps = [ name = "interactive search preserves rating within package" cwd = "packages/lib" steps = [ - { command = "vt run", interactions = [ + { argv = [ + "vt", + "run", + ], interactions = [ { "expect-milestone" = "task-select::0" }, { "write" = "t" }, { "expect-milestone" = "task-select:t:0" }, @@ -172,7 +200,10 @@ steps = [ name = "interactive enter with no results does nothing" cwd = "packages/app" steps = [ - { command = "vt run", interactions = [ + { argv = [ + "vt", + "run", + ], interactions = [ { "expect-milestone" = "task-select::0" }, { "write" = "zzzzz" }, { "expect-milestone" = "task-select:zzzzz:0" }, @@ -188,7 +219,10 @@ steps = [ name = "interactive select from other package" cwd = "packages/app" steps = [ - { command = "vt run", interactions = [ + { argv = [ + "vt", + "run", + ], interactions = [ { "expect-milestone" = "task-select::0" }, { "write-key" = "down" }, { "write-key" = "down" }, @@ -201,7 +235,7 @@ steps = [ # Typo inside a task script should fail with an error, NOT show a list [[e2e]] name = "typo in task script fails without list" -steps = ["vt run run-typo-task"] +steps = [["vt", "run", "run-typo-task"]] # Interactive: Ctrl+C cancels selection and exits with code 130 [[e2e]] @@ -218,14 +252,19 @@ steps = [ [[e2e]] name = "verbose without task errors" cwd = "packages/app" -steps = ["vt run --verbose"] +steps = [["vt", "run", "--verbose"]] # --verbose with typo: is_cwd_only is true, shows interactive selector [[e2e]] name = "verbose with typo enters selector" cwd = "packages/app" steps = [ - { command = "vt run --verbose buid", interactions = [ + { argv = [ + "vt", + "run", + "--verbose", + "buid", + ], interactions = [ { "expect-milestone" = "task-select:buid:0" }, { "write-key" = "enter" }, ] }, diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-select/snapshots/non-interactive did you mean.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-select/snapshots/non-interactive did you mean.snap index 0286354c..41a80b21 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-select/snapshots/non-interactive did you mean.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-select/snapshots/non-interactive did you mean.snap @@ -2,7 +2,7 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- -[1]> echo '' | vt run buid +[1]> vtt pipe-stdin -- vt run buid Task "buid" not found. Did you mean: app#build: echo build app lib#build: echo build lib diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-select/snapshots/non-interactive list tasks from lib.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-select/snapshots/non-interactive list tasks from lib.snap index 194dd017..7618d10d 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-select/snapshots/non-interactive list tasks from lib.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-select/snapshots/non-interactive list tasks from lib.snap @@ -4,7 +4,7 @@ expression: e2e_outputs info: cwd: packages/lib --- -> echo '' | vt run +> vtt pipe-stdin -- vt run build: echo build lib lint: echo lint lib test: echo test lib diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-select/snapshots/non-interactive list tasks.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-select/snapshots/non-interactive list tasks.snap index 355fd644..bc74e817 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-select/snapshots/non-interactive list tasks.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-select/snapshots/non-interactive list tasks.snap @@ -2,7 +2,7 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- -> echo '' | vt run +> vtt pipe-stdin -- vt run check: echo check root clean: echo clean root deploy: echo deploy root diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-select/snapshots/non-interactive no suggestions.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-select/snapshots/non-interactive no suggestions.snap index e5387b7a..1843e99b 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-select/snapshots/non-interactive no suggestions.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-select/snapshots/non-interactive no suggestions.snap @@ -2,5 +2,5 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- -[1]> echo '' | vt run zzzzz +[1]> vtt pipe-stdin -- vt run zzzzz Task "zzzzz" not found. diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-select/snapshots/non-interactive recursive typo errors.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-select/snapshots/non-interactive recursive typo errors.snap index bcc3c8ec..c93d8737 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-select/snapshots/non-interactive recursive typo errors.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-select/snapshots/non-interactive recursive typo errors.snap @@ -2,5 +2,5 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- -[1]> echo '' | vt run -r buid +[1]> vtt pipe-stdin -- vt run -r buid Error: Task "buid" not found diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/topological-execution-order/snapshots.toml b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/topological-execution-order/snapshots.toml index db0d6bbb..c60d6da3 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/topological-execution-order/snapshots.toml +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/topological-execution-order/snapshots.toml @@ -3,14 +3,14 @@ [[e2e]] name = "recursive build runs dependencies before dependents" -steps = ["vt run -r build # core -> lib -> app"] +steps = [{ argv = ["vt", "run", "-r", "build"], comment = "core -> lib -> app" }] [[e2e]] name = "transitive build from app runs all dependencies" cwd = "packages/app" -steps = ["vt run -t build # core -> lib -> app"] +steps = [{ argv = ["vt", "run", "-t", "build"], comment = "core -> lib -> app" }] [[e2e]] name = "transitive build from lib runs only its dependencies" cwd = "packages/lib" -steps = ["vt run -t build # core -> lib"] +steps = [{ argv = ["vt", "run", "-t", "build"], comment = "core -> lib" }] diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/vite-task-smoke/snapshots.toml b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/vite-task-smoke/snapshots.toml index 16cc13df..8618f74d 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/vite-task-smoke/snapshots.toml +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/vite-task-smoke/snapshots.toml @@ -3,7 +3,21 @@ [[e2e]] name = "cache hit after file modification" steps = [ - "vt run test-task # cache miss", - "vtt replace-file-content main.js foo bar # modify input file", - "vt run test-task # cache miss, main.js changed", + { argv = [ + "vt", + "run", + "test-task", + ], comment = "cache miss" }, + { argv = [ + "vtt", + "replace-file-content", + "main.js", + "foo", + "bar", + ], comment = "modify input file" }, + { argv = [ + "vt", + "run", + "test-task", + ], comment = "cache miss, main.js changed" }, ] diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/workspace-root-self-reference/snapshots.toml b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/workspace-root-self-reference/snapshots.toml index 4ec9bb9d..3c0fa02e 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/workspace-root-self-reference/snapshots.toml +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/workspace-root-self-reference/snapshots.toml @@ -12,8 +12,8 @@ [[e2e]] name = "recursive build skips root self-reference" -steps = ["vt run -r build # only a and b run, root is skipped"] +steps = [{ argv = ["vt", "run", "-r", "build"], comment = "only a and b run, root is skipped" }] [[e2e]] name = "build from root prunes root from nested expansion" -steps = ["vt run build # only a and b run under root, root is pruned"] +steps = [{ argv = ["vt", "run", "build"], comment = "only a and b run under root, root is pruned" }] diff --git a/crates/vite_task_bin/tests/e2e_snapshots/main.rs b/crates/vite_task_bin/tests/e2e_snapshots/main.rs index b1d800da..bb7a0c93 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/main.rs +++ b/crates/vite_task_bin/tests/e2e_snapshots/main.rs @@ -12,6 +12,7 @@ use cp_r::CopyOptions; use pty_terminal::{geo::ScreenSize, terminal::CommandBuilder}; use pty_terminal_test::TestTerminal; use redact::redact_e2e_output; +use vec1::Vec1; use vite_path::{AbsolutePath, AbsolutePathBuf, RelativePathBuf}; use vite_str::Str; use vite_workspace::find_workspace_root; @@ -24,63 +25,81 @@ const STEP_TIMEOUT: Duration = /// Screen size for the PTY terminal. Large enough to avoid line wrapping. const SCREEN_SIZE: ScreenSize = ScreenSize { rows: 500, cols: 500 }; -/// Get the shell executable for running e2e test steps. -/// On Unix, uses /bin/sh. -/// On Windows, uses BASH env var or falls back to Git Bash. -#[expect( - clippy::disallowed_types, - reason = "PathBuf required for CommandBuilder and std::path operations on shell executable" -)] -fn get_shell_exe() -> std::path::PathBuf { - if cfg!(windows) { - std::env::var_os("BASH").map_or_else( - || { - let git_bash = std::path::PathBuf::from(r"C:\Program Files\Git\bin\bash.exe"); - if git_bash.exists() { - git_bash - } else { - panic!( - "Could not find bash executable for e2e tests.\n\ - Please set the BASH environment variable to point to a bash executable,\n\ - or install Git for Windows which provides bash at:\n\ - C:\\Program Files\\Git\\bin\\bash.exe" - ); - } - }, - std::path::PathBuf::from, - ) - } else { - std::path::PathBuf::from("/bin/sh") - } -} - #[derive(serde::Deserialize, Debug)] #[serde(untagged)] enum Step { - Command(Str), + /// Shorthand: `["vt", "run", "build"]` + Simple(Vec1), + /// Detailed: `{ argv = ["vt", "run"], comment = "cache miss", ... }` Detailed(StepConfig), } #[derive(serde::Deserialize, Debug)] #[serde(deny_unknown_fields)] struct StepConfig { - command: Str, + argv: Vec1, + /// Appended as `# comment` in the snapshot display line. + #[serde(default)] + comment: Option, + /// Extra environment variables set for this step. + #[serde(default)] + envs: Vec<(Str, Str)>, #[serde(default)] interactions: Vec, } impl Step { - fn command(&self) -> &str { + fn argv(&self) -> &[Str] { match self { - Self::Command(command) => command.as_str(), - Self::Detailed(config) => config.command.as_str(), + Self::Simple(argv) => argv, + Self::Detailed(config) => &config.argv, + } + } + + /// Format as a shell-like display string for snapshots (e.g. `MY_ENV=1 vt run test # cache miss`). + #[expect(clippy::disallowed_types, reason = "String required by join/format")] + fn display_command(&self) -> String { + let argv_str = self + .argv() + .iter() + .map(|a| { + let s = a.as_str(); + if s.contains(|c: char| c.is_whitespace() || c == '"') { + shell_escape::escape(s.into()) + } else { + s.into() + } + }) + .collect::>() + .join(" "); + + match self { + Self::Simple(_) => argv_str, + Self::Detailed(config) => { + let mut parts = String::new(); + for (k, v) in &config.envs { + parts.push_str(vite_str::format!("{k}={v} ").as_str()); + } + parts.push_str(&argv_str); + if let Some(comment) = &config.comment { + parts.push_str(vite_str::format!(" # {comment}").as_str()); + } + parts + } } } fn interactions(&self) -> &[Interaction] { match self { - Self::Command(_) => &[], Self::Detailed(config) => &config.interactions, + _ => &[], + } + } + + fn envs(&self) -> &[(Str, Str)] { + match self { + Self::Detailed(config) => &config.envs, + _ => &[], } } } @@ -231,9 +250,6 @@ fn run_case_inner(tmpdir: &AbsolutePath, fixture_path: &std::path::Path, fixture Err(err) => panic!("Failed to read cases.toml for fixture {fixture_name}: {err}"), }; - // Get shell executable for running steps - let shell_exe = get_shell_exe(); - // Prepare PATH for e2e tests: include vt and vtt binary directories. let bin_dirs: [Arc; 2] = ["CARGO_BIN_EXE_vt", "CARGO_BIN_EXE_vtt"].map(|var| { let bin_path = env::var_os(var).unwrap_or_else(|| panic!("{var} not set")); @@ -241,7 +257,7 @@ fn run_case_inner(tmpdir: &AbsolutePath, fixture_path: &std::path::Path, fixture Arc::::from(bin.parent().unwrap().as_path().as_os_str()) }); let e2e_env_path = join_paths( - bin_dirs.into_iter().chain( + bin_dirs.iter().cloned().chain( // the existing PATH split_paths(&env::var_os("PATH").unwrap()) .map(|path| Arc::::from(path.into_os_string())), @@ -279,22 +295,35 @@ fn run_case_inner(tmpdir: &AbsolutePath, fixture_path: &std::path::Path, fixture let mut e2e_outputs = String::new(); for step in &e2e.steps { - let step_command = step.command(); - let mut cmd = CommandBuilder::new(&shell_exe); - cmd.arg("-c"); - cmd.arg(step_command); + let step_display = step.display_command(); + + let argv = step.argv(); + + // Only vt and vtt are allowed as step programs. + let program = argv[0].as_str(); + assert!( + program == "vt" || program == "vtt", + "step program must be 'vt' or 'vtt', got '{program}'" + ); + let exe_env = vite_str::format!("CARGO_BIN_EXE_{program}"); + let resolved = + env::var_os(exe_env.as_str()).unwrap_or_else(|| panic!("{exe_env} not set")); + let mut cmd = CommandBuilder::new(resolved); + for arg in &argv[1..] { + cmd.arg(arg.as_str()); + } cmd.env_clear(); cmd.env("PATH", &e2e_env_path); cmd.env("NO_COLOR", "1"); cmd.env("TERM", "dumb"); - cmd.cwd(e2e_stage_path.join(&e2e.cwd).as_path()); - - // On Windows, inherit PATHEXT for executable lookup - if cfg!(windows) - && let Ok(pathext) = std::env::var("PATHEXT") - { - cmd.env("PATHEXT", pathext); + // On Windows, ensure common executable extensions are included in PATHEXT for command resolution in subprocesses. + if cfg!(windows) { + cmd.env("PATHEXT", ".COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC"); } + for (k, v) in step.envs() { + cmd.env(k.as_str(), v.as_str()); + } + cmd.cwd(e2e_stage_path.join(&e2e.cwd).as_path()); let terminal = TestTerminal::spawn(SCREEN_SIZE, cmd).unwrap(); let mut killer = terminal.child_handle.clone(); @@ -393,7 +422,7 @@ fn run_case_inner(tmpdir: &AbsolutePath, fixture_path: &std::path::Path, fixture } e2e_outputs.push_str("> "); - e2e_outputs.push_str(step_command); + e2e_outputs.push_str(&step_display); e2e_outputs.push('\n'); e2e_outputs.push_str(&redact_e2e_output(output, e2e_stage_path_str)); @@ -415,9 +444,6 @@ fn run_case_inner(tmpdir: &AbsolutePath, fixture_path: &std::path::Path, fixture } fn main() { - // SAFETY: Called before any threads are spawned; insta reads this lazily on first assertion. - unsafe { std::env::set_var("INSTA_REQUIRE_FULL_MATCH", "1") }; - let filter = std::env::args().nth(1); let tmp_dir = tempfile::tempdir().unwrap(); @@ -433,7 +459,7 @@ fn main() { // Copy .node-version to the tmp dir so version manager shims can resolve the correct // Node.js binary when running task commands. - let repo_root = manifest_dir.join("../..").canonicalize().unwrap(); + let repo_root = manifest_dir.parent().unwrap().parent().unwrap(); std::fs::copy(repo_root.join(".node-version"), tmp_dir.path().join(".node-version")) .unwrap(); From 80980a2a40e29a754a3dbeeb096e4e14e8d7f406 Mon Sep 17 00:00:00 2001 From: branchseer Date: Sun, 29 Mar 2026 00:01:25 +0800 Subject: [PATCH 2/2] test(e2e): remove node dependency from fixtures MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replace all `node` usages in e2e test fixtures with vtt subcommands: - `node -e "process.exit(N)"` → `vtt exit N` (new subcommand) - `node read_node_fs.js` → `vtt print` (test only needs a successful command) - Remove `replay-logs-chronological-order` fixture (complex node script) This eliminates the dependency on `node` being in PATH for e2e tests. Co-Authored-By: Claude Opus 4.6 (1M context) --- crates/vite_task_bin/src/vtt/exit.rs | 4 + crates/vite_task_bin/src/vtt/main.rs | 4 +- crates/vite_task_bin/src/vtt/pipe_stdin.rs | 2 +- .../fixtures/colon-in-name/package.json | 2 +- .../fixtures/colon-in-name/read_node_fs.js | 3 - .../fixtures/colon-in-name/snapshots.toml | 2 +- .../read file with colon in name.snap | 6 +- .../exit-codes/packages/pkg-a/package.json | 6 +- .../exit-codes/packages/pkg-b/package.json | 2 +- ...ommand with && stops at first failure.snap | 2 +- ...endency failure fast-fails dependents.snap | 2 +- ...e task failure returns task exit code.snap | 2 +- ...sk failure fast-fails remaining tasks.snap | 2 +- .../replay-logs-chronological-order/build.js | 97 ------ .../replay-logs-chronological-order/echo.js | 4 - .../package.json | 6 - .../snapshots.toml | 21 -- .../replay logs chronological order.snap | 295 ------------------ .../vite-task.json | 3 - .../fixtures/task-select/snapshots.toml | 5 +- .../vite_task_bin/tests/e2e_snapshots/main.rs | 4 +- 21 files changed, 28 insertions(+), 446 deletions(-) create mode 100644 crates/vite_task_bin/src/vtt/exit.rs delete mode 100644 crates/vite_task_bin/tests/e2e_snapshots/fixtures/colon-in-name/read_node_fs.js delete mode 100644 crates/vite_task_bin/tests/e2e_snapshots/fixtures/replay-logs-chronological-order/build.js delete mode 100644 crates/vite_task_bin/tests/e2e_snapshots/fixtures/replay-logs-chronological-order/echo.js delete mode 100644 crates/vite_task_bin/tests/e2e_snapshots/fixtures/replay-logs-chronological-order/package.json delete mode 100644 crates/vite_task_bin/tests/e2e_snapshots/fixtures/replay-logs-chronological-order/snapshots.toml delete mode 100644 crates/vite_task_bin/tests/e2e_snapshots/fixtures/replay-logs-chronological-order/snapshots/replay logs chronological order.snap delete mode 100644 crates/vite_task_bin/tests/e2e_snapshots/fixtures/replay-logs-chronological-order/vite-task.json diff --git a/crates/vite_task_bin/src/vtt/exit.rs b/crates/vite_task_bin/src/vtt/exit.rs new file mode 100644 index 00000000..eb33608a --- /dev/null +++ b/crates/vite_task_bin/src/vtt/exit.rs @@ -0,0 +1,4 @@ +pub fn run(args: &[String]) -> Result<(), Box> { + let code: i32 = args.first().map(|s| s.parse()).transpose()?.unwrap_or(0); + std::process::exit(code); +} diff --git a/crates/vite_task_bin/src/vtt/main.rs b/crates/vite_task_bin/src/vtt/main.rs index 48886445..a51014d3 100644 --- a/crates/vite_task_bin/src/vtt/main.rs +++ b/crates/vite_task_bin/src/vtt/main.rs @@ -9,6 +9,7 @@ mod barrier; mod check_tty; mod cp; +mod exit; mod mkdir; mod pipe_stdin; mod print; @@ -26,7 +27,7 @@ fn main() { if args.len() < 2 { eprintln!("Usage: vtt [args...]"); eprintln!( - "Subcommands: barrier, check-tty, cp, mkdir, pipe-stdin, print, print-cwd, print-env, print-file, read-stdin, replace-file-content, rm, touch-file, write-file" + "Subcommands: barrier, check-tty, cp, exit, mkdir, pipe-stdin, print, print-cwd, print-env, print-file, read-stdin, replace-file-content, rm, touch-file, write-file" ); std::process::exit(1); } @@ -38,6 +39,7 @@ fn main() { Ok(()) } "cp" => cp::run(&args[2..]), + "exit" => exit::run(&args[2..]), "mkdir" => mkdir::run(&args[2..]), "print" => { print::run(&args[2..]); diff --git a/crates/vite_task_bin/src/vtt/pipe_stdin.rs b/crates/vite_task_bin/src/vtt/pipe_stdin.rs index af4ea318..92f6e6f6 100644 --- a/crates/vite_task_bin/src/vtt/pipe_stdin.rs +++ b/crates/vite_task_bin/src/vtt/pipe_stdin.rs @@ -1,4 +1,4 @@ -/// pipe-stdin `` -- `` [``...] +/// pipe-stdin `` -- `` \[``...\] /// /// Spawns `` with `` piped to its stdin, then exits with /// the child's exit code. If `` is empty, an empty stdin is provided. diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/colon-in-name/package.json b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/colon-in-name/package.json index fde0ba16..a1736379 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/colon-in-name/package.json +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/colon-in-name/package.json @@ -1,5 +1,5 @@ { "scripts": { - "read_colon_in_name": "node read_node_fs.js" + "read_colon_in_name": "vtt print-file node:fs" } } diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/colon-in-name/read_node_fs.js b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/colon-in-name/read_node_fs.js deleted file mode 100644 index 8184bed3..00000000 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/colon-in-name/read_node_fs.js +++ /dev/null @@ -1,3 +0,0 @@ -try { - require('node:fs').readFileSync('node:fs'); -} catch {} diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/colon-in-name/snapshots.toml b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/colon-in-name/snapshots.toml index 14e43156..82b918d4 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/colon-in-name/snapshots.toml +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/colon-in-name/snapshots.toml @@ -1,4 +1,4 @@ -# Tests that fs.read('node:fs') with colon in filename works correctly +# Tests that a task name with colon works correctly with caching [[e2e]] name = "read file with colon in name" diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/colon-in-name/snapshots/read file with colon in name.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/colon-in-name/snapshots/read file with colon in name.snap index ea55f5a4..14f35a70 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/colon-in-name/snapshots/read file with colon in name.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/colon-in-name/snapshots/read file with colon in name.snap @@ -3,9 +3,11 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- > vt run read_colon_in_name # cache miss -$ node read_node_fs.js +$ vtt print-file node:fs +node:fs: not found > vt run read_colon_in_name # cache hit -$ node read_node_fs.js ◉ cache hit, replaying +$ vtt print-file node:fs ◉ cache hit, replaying +node:fs: not found --- vt run: cache hit. diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/exit-codes/packages/pkg-a/package.json b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/exit-codes/packages/pkg-a/package.json index df93e64d..ac552498 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/exit-codes/packages/pkg-a/package.json +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/exit-codes/packages/pkg-a/package.json @@ -1,8 +1,8 @@ { "name": "pkg-a", "scripts": { - "fail": "node -e \"process.exit(42)\"", - "check": "node -e \"process.exit(1)\"", - "chained": "node -e \"process.exit(3)\" && echo 'second'" + "fail": "vtt exit 42", + "check": "vtt exit 1", + "chained": "vtt exit 3 && echo 'second'" } } diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/exit-codes/packages/pkg-b/package.json b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/exit-codes/packages/pkg-b/package.json index 61d5ea09..1dcdb707 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/exit-codes/packages/pkg-b/package.json +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/exit-codes/packages/pkg-b/package.json @@ -1,7 +1,7 @@ { "name": "pkg-b", "scripts": { - "fail": "node -e \"process.exit(7)\"", + "fail": "vtt exit 7", "check": "echo 'pkg-b check passed'" }, "dependencies": { diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/exit-codes/snapshots/chained command with && stops at first failure.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/exit-codes/snapshots/chained command with && stops at first failure.snap index d5fbe215..50dfe4db 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/exit-codes/snapshots/chained command with && stops at first failure.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/exit-codes/snapshots/chained command with && stops at first failure.snap @@ -3,4 +3,4 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- [3]> vt run pkg-a#chained # first fails with exit code 3, second should not run -~/packages/pkg-a$ node -e "process.exit(3)" +~/packages/pkg-a$ vtt exit 3 diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/exit-codes/snapshots/dependency failure fast-fails dependents.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/exit-codes/snapshots/dependency failure fast-fails dependents.snap index fb776d54..0506fb32 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/exit-codes/snapshots/dependency failure fast-fails dependents.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/exit-codes/snapshots/dependency failure fast-fails dependents.snap @@ -5,4 +5,4 @@ info: cwd: packages/pkg-b --- [1]> vt run -t check # pkg-a fails, pkg-b is skipped -~/packages/pkg-a$ node -e "process.exit(1)" +~/packages/pkg-a$ vtt exit 1 diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/exit-codes/snapshots/single task failure returns task exit code.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/exit-codes/snapshots/single task failure returns task exit code.snap index a8e9d7fb..31f09693 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/exit-codes/snapshots/single task failure returns task exit code.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/exit-codes/snapshots/single task failure returns task exit code.snap @@ -3,4 +3,4 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- [42]> vt run pkg-a#fail # exits with code 42 -~/packages/pkg-a$ node -e "process.exit(42)" +~/packages/pkg-a$ vtt exit 42 diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/exit-codes/snapshots/task failure fast-fails remaining tasks.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/exit-codes/snapshots/task failure fast-fails remaining tasks.snap index 050efc48..2a434927 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/exit-codes/snapshots/task failure fast-fails remaining tasks.snap +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/exit-codes/snapshots/task failure fast-fails remaining tasks.snap @@ -3,4 +3,4 @@ source: crates/vite_task_bin/tests/e2e_snapshots/main.rs expression: e2e_outputs --- [42]> vt run -r fail # pkg-a fails, pkg-b is skipped -~/packages/pkg-a$ node -e "process.exit(42)" +~/packages/pkg-a$ vtt exit 42 diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/replay-logs-chronological-order/build.js b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/replay-logs-chronological-order/build.js deleted file mode 100644 index 53493e04..00000000 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/replay-logs-chronological-order/build.js +++ /dev/null @@ -1,97 +0,0 @@ -import { spawn } from 'node:child_process'; -import { scheduler } from 'node:timers/promises'; - -async function main() { - const commands = [ - ['node', ['echo.js', '1'.repeat(100)], { stdio: 'inherit' }], - ['node', ['echo.js', '2'.repeat(100)], { stdio: 'inherit' }], - ['node', ['echo.js', '3'.repeat(100)], { stdio: 'inherit' }], - ['node', ['echo.js', '4'.repeat(100)], { stdio: 'inherit' }], - ['node', ['echo.js', '5'.repeat(100)], { stdio: 'inherit' }], - ['node', ['echo.js', '6'.repeat(100)], { stdio: 'inherit' }], - ['node', ['echo.js', '7'.repeat(100)], { stdio: 'inherit' }], - ['node', ['echo.js', '8'.repeat(100)], { stdio: 'inherit' }], - ['node', ['echo.js', '9'.repeat(100)], { stdio: 'inherit' }], - ['node', ['echo.js', '10'.repeat(100)], { stdio: 'inherit' }], - ['node', ['echo.js', '11'.repeat(100)], { stdio: 'inherit' }], - ['node', ['echo.js', '12'.repeat(100)], { stdio: 'inherit' }], - ['node', ['echo.js', '13'.repeat(100)], { stdio: 'inherit' }], - ['node', ['echo.js', '14'.repeat(100)], { stdio: 'inherit' }], - ['node', ['echo.js', '15'.repeat(100)], { stdio: 'inherit' }], - ['node', ['echo.js', '16'.repeat(100)], { stdio: 'inherit' }], - ['node', ['echo.js', '17'.repeat(100)], { stdio: 'inherit' }], - ['node', ['echo.js', '18'.repeat(100)], { stdio: 'inherit' }], - ['node', ['echo.js', '19'.repeat(100)], { stdio: 'inherit' }], - ['node', ['echo.js', '20'.repeat(100)], { stdio: 'inherit' }], - ['node', ['echo.js', '21'.repeat(100)], { stdio: 'inherit' }], - ['node', ['echo.js', '22'.repeat(100)], { stdio: 'inherit' }], - ['node', ['echo.js', '23'.repeat(100)], { stdio: 'inherit' }], - ['node', ['echo.js', '24'.repeat(100)], { stdio: 'inherit' }], - ['node', ['echo.js', '25'.repeat(100)], { stdio: 'inherit' }], - ['node', ['echo.js', '26'.repeat(100)], { stdio: 'inherit' }], - ['node', ['echo.js', '27'.repeat(100)], { stdio: 'inherit' }], - ['node', ['echo.js', '28'.repeat(100)], { stdio: 'inherit' }], - ['node', ['echo.js', '29'.repeat(100)], { stdio: 'inherit' }], - ['node', ['echo.js', '30'.repeat(100)], { stdio: 'inherit' }], - ]; - - console.log('[build.js] --------------------------------'); - console.log('[build.js] start'); - - for (const command of commands) { - await exec(...command); - } - - // Wait for 100ms to ensure all child process output streams are fully flushed - await scheduler.wait(100); - console.log('[build.js] main process end'); -} - -main().catch(console.error); - -/** - * @param {string} command - * @param {ReadonlyArray} args - * @param {object} [options] - */ -export async function exec(command, args, options) { - return new Promise((resolve, reject) => { - const _process = spawn(command, args, { - stdio: [ - 'ignore', // stdin - 'pipe', // stdout - 'pipe', // stderr - ], - ...options, - shell: process.platform === 'win32', - }); - - const stderrChunks = []; - const stdoutChunks = []; - - _process.stderr?.on('data', (chunk) => { - stderrChunks.push(chunk); - }); - - _process.stdout?.on('data', (chunk) => { - stdoutChunks.push(chunk); - }); - - _process.on('error', (error) => { - reject(error); - }); - - _process.on('exit', (code) => { - const ok = code === 0; - const stderr = Buffer.concat(stderrChunks).toString().trim(); - const stdout = Buffer.concat(stdoutChunks).toString().trim(); - - if (ok) { - const result = { ok, code, stderr, stdout }; - resolve(result); - } else { - reject(new Error(`Failed to execute command: ${command} ${args.join(' ')}: ${stderr}`)); - } - }); - }); -} diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/replay-logs-chronological-order/echo.js b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/replay-logs-chronological-order/echo.js deleted file mode 100644 index 7ad9d54b..00000000 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/replay-logs-chronological-order/echo.js +++ /dev/null @@ -1,4 +0,0 @@ -const args = process.argv.slice(2); -console.warn('[echo.js] --------------------------------'); -console.warn('[echo.js] ' + args.join(' ')); -console.warn('[echo.js] --------------------------------'); diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/replay-logs-chronological-order/package.json b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/replay-logs-chronological-order/package.json deleted file mode 100644 index e670719a..00000000 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/replay-logs-chronological-order/package.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "type": "module", - "scripts": { - "build": "node build.js" - } -} diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/replay-logs-chronological-order/snapshots.toml b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/replay-logs-chronological-order/snapshots.toml deleted file mode 100644 index f3ee22aa..00000000 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/replay-logs-chronological-order/snapshots.toml +++ /dev/null @@ -1,21 +0,0 @@ -# Tests that replayed logs maintain chronological order - -[[e2e]] -name = "replay logs chronological order" -steps = [ - { argv = [ - "vt", - "run", - "build", - ], comment = "cache miss" }, - { argv = [ - "vt", - "run", - "build", - ], comment = "cache hit" }, - { argv = [ - "vt", - "run", - "build", - ], comment = "cache hit" }, -] diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/replay-logs-chronological-order/snapshots/replay logs chronological order.snap b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/replay-logs-chronological-order/snapshots/replay logs chronological order.snap deleted file mode 100644 index d16d57d0..00000000 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/replay-logs-chronological-order/snapshots/replay logs chronological order.snap +++ /dev/null @@ -1,295 +0,0 @@ ---- -source: crates/vite_task_bin/tests/e2e_snapshots/main.rs -expression: e2e_outputs ---- -> vt run build # cache miss -$ node build.js -[build.js] -------------------------------- -[build.js] start -[echo.js] -------------------------------- -[echo.js] 1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 -[echo.js] -------------------------------- -[echo.js] -------------------------------- -[echo.js] 2222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222 -[echo.js] -------------------------------- -[echo.js] -------------------------------- -[echo.js] 3333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333 -[echo.js] -------------------------------- -[echo.js] -------------------------------- -[echo.js] 4444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444 -[echo.js] -------------------------------- -[echo.js] -------------------------------- -[echo.js] 5555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555 -[echo.js] -------------------------------- -[echo.js] -------------------------------- -[echo.js] 6666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666 -[echo.js] -------------------------------- -[echo.js] -------------------------------- -[echo.js] 7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777 -[echo.js] -------------------------------- -[echo.js] -------------------------------- -[echo.js] 8888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888 -[echo.js] -------------------------------- -[echo.js] -------------------------------- -[echo.js] 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999 -[echo.js] -------------------------------- -[echo.js] -------------------------------- -[echo.js] 10101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010 -[echo.js] -------------------------------- -[echo.js] -------------------------------- -[echo.js] 11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 -[echo.js] -------------------------------- -[echo.js] -------------------------------- -[echo.js] 12121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212 -[echo.js] -------------------------------- -[echo.js] -------------------------------- -[echo.js] 13131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313 -[echo.js] -------------------------------- -[echo.js] -------------------------------- -[echo.js] 14141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414 -[echo.js] -------------------------------- -[echo.js] -------------------------------- -[echo.js] 15151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515 -[echo.js] -------------------------------- -[echo.js] -------------------------------- -[echo.js] 16161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616 -[echo.js] -------------------------------- -[echo.js] -------------------------------- -[echo.js] 17171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717 -[echo.js] -------------------------------- -[echo.js] -------------------------------- -[echo.js] 18181818181818181818181818181818181818181818181818181818181818181818181818181818181818181818181818181818181818181818181818181818181818181818181818181818181818181818181818181818181818181818181818181818 -[echo.js] -------------------------------- -[echo.js] -------------------------------- -[echo.js] 19191919191919191919191919191919191919191919191919191919191919191919191919191919191919191919191919191919191919191919191919191919191919191919191919191919191919191919191919191919191919191919191919191919 -[echo.js] -------------------------------- -[echo.js] -------------------------------- -[echo.js] 20202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020 -[echo.js] -------------------------------- -[echo.js] -------------------------------- -[echo.js] 21212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121 -[echo.js] -------------------------------- -[echo.js] -------------------------------- -[echo.js] 22222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222 -[echo.js] -------------------------------- -[echo.js] -------------------------------- -[echo.js] 23232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323 -[echo.js] -------------------------------- -[echo.js] -------------------------------- -[echo.js] 24242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424 -[echo.js] -------------------------------- -[echo.js] -------------------------------- -[echo.js] 25252525252525252525252525252525252525252525252525252525252525252525252525252525252525252525252525252525252525252525252525252525252525252525252525252525252525252525252525252525252525252525252525252525 -[echo.js] -------------------------------- -[echo.js] -------------------------------- -[echo.js] 26262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626 -[echo.js] -------------------------------- -[echo.js] -------------------------------- -[echo.js] 27272727272727272727272727272727272727272727272727272727272727272727272727272727272727272727272727272727272727272727272727272727272727272727272727272727272727272727272727272727272727272727272727272727 -[echo.js] -------------------------------- -[echo.js] -------------------------------- -[echo.js] 28282828282828282828282828282828282828282828282828282828282828282828282828282828282828282828282828282828282828282828282828282828282828282828282828282828282828282828282828282828282828282828282828282828 -[echo.js] -------------------------------- -[echo.js] -------------------------------- -[echo.js] 29292929292929292929292929292929292929292929292929292929292929292929292929292929292929292929292929292929292929292929292929292929292929292929292929292929292929292929292929292929292929292929292929292929 -[echo.js] -------------------------------- -[echo.js] -------------------------------- -[echo.js] 30303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030 -[echo.js] -------------------------------- -[build.js] main process end -> vt run build # cache hit -$ node build.js ◉ cache hit, replaying -[build.js] -------------------------------- -[build.js] start -[echo.js] -------------------------------- -[echo.js] 1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 -[echo.js] -------------------------------- -[echo.js] -------------------------------- -[echo.js] 2222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222 -[echo.js] -------------------------------- -[echo.js] -------------------------------- -[echo.js] 3333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333 -[echo.js] -------------------------------- -[echo.js] -------------------------------- -[echo.js] 4444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444 -[echo.js] -------------------------------- -[echo.js] -------------------------------- -[echo.js] 5555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555 -[echo.js] -------------------------------- -[echo.js] -------------------------------- -[echo.js] 6666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666 -[echo.js] -------------------------------- -[echo.js] -------------------------------- -[echo.js] 7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777 -[echo.js] -------------------------------- -[echo.js] -------------------------------- -[echo.js] 8888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888 -[echo.js] -------------------------------- -[echo.js] -------------------------------- -[echo.js] 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999 -[echo.js] -------------------------------- -[echo.js] -------------------------------- -[echo.js] 10101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010 -[echo.js] -------------------------------- -[echo.js] -------------------------------- -[echo.js] 11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 -[echo.js] -------------------------------- -[echo.js] -------------------------------- -[echo.js] 12121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212 -[echo.js] -------------------------------- -[echo.js] -------------------------------- -[echo.js] 13131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313 -[echo.js] -------------------------------- -[echo.js] -------------------------------- -[echo.js] 14141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414 -[echo.js] -------------------------------- -[echo.js] -------------------------------- -[echo.js] 15151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515 -[echo.js] -------------------------------- -[echo.js] -------------------------------- -[echo.js] 16161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616 -[echo.js] -------------------------------- -[echo.js] -------------------------------- -[echo.js] 17171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717 -[echo.js] -------------------------------- -[echo.js] -------------------------------- -[echo.js] 18181818181818181818181818181818181818181818181818181818181818181818181818181818181818181818181818181818181818181818181818181818181818181818181818181818181818181818181818181818181818181818181818181818 -[echo.js] -------------------------------- -[echo.js] -------------------------------- -[echo.js] 19191919191919191919191919191919191919191919191919191919191919191919191919191919191919191919191919191919191919191919191919191919191919191919191919191919191919191919191919191919191919191919191919191919 -[echo.js] -------------------------------- -[echo.js] -------------------------------- -[echo.js] 20202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020 -[echo.js] -------------------------------- -[echo.js] -------------------------------- -[echo.js] 21212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121 -[echo.js] -------------------------------- -[echo.js] -------------------------------- -[echo.js] 22222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222 -[echo.js] -------------------------------- -[echo.js] -------------------------------- -[echo.js] 23232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323 -[echo.js] -------------------------------- -[echo.js] -------------------------------- -[echo.js] 24242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424 -[echo.js] -------------------------------- -[echo.js] -------------------------------- -[echo.js] 25252525252525252525252525252525252525252525252525252525252525252525252525252525252525252525252525252525252525252525252525252525252525252525252525252525252525252525252525252525252525252525252525252525 -[echo.js] -------------------------------- -[echo.js] -------------------------------- -[echo.js] 26262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626 -[echo.js] -------------------------------- -[echo.js] -------------------------------- -[echo.js] 27272727272727272727272727272727272727272727272727272727272727272727272727272727272727272727272727272727272727272727272727272727272727272727272727272727272727272727272727272727272727272727272727272727 -[echo.js] -------------------------------- -[echo.js] -------------------------------- -[echo.js] 28282828282828282828282828282828282828282828282828282828282828282828282828282828282828282828282828282828282828282828282828282828282828282828282828282828282828282828282828282828282828282828282828282828 -[echo.js] -------------------------------- -[echo.js] -------------------------------- -[echo.js] 29292929292929292929292929292929292929292929292929292929292929292929292929292929292929292929292929292929292929292929292929292929292929292929292929292929292929292929292929292929292929292929292929292929 -[echo.js] -------------------------------- -[echo.js] -------------------------------- -[echo.js] 30303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030 -[echo.js] -------------------------------- -[build.js] main process end - ---- -vt run: cache hit. -> vt run build # cache hit -$ node build.js ◉ cache hit, replaying -[build.js] -------------------------------- -[build.js] start -[echo.js] -------------------------------- -[echo.js] 1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 -[echo.js] -------------------------------- -[echo.js] -------------------------------- -[echo.js] 2222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222 -[echo.js] -------------------------------- -[echo.js] -------------------------------- -[echo.js] 3333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333 -[echo.js] -------------------------------- -[echo.js] -------------------------------- -[echo.js] 4444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444444 -[echo.js] -------------------------------- -[echo.js] -------------------------------- -[echo.js] 5555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555555 -[echo.js] -------------------------------- -[echo.js] -------------------------------- -[echo.js] 6666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666666 -[echo.js] -------------------------------- -[echo.js] -------------------------------- -[echo.js] 7777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777777 -[echo.js] -------------------------------- -[echo.js] -------------------------------- -[echo.js] 8888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888 -[echo.js] -------------------------------- -[echo.js] -------------------------------- -[echo.js] 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999 -[echo.js] -------------------------------- -[echo.js] -------------------------------- -[echo.js] 10101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010 -[echo.js] -------------------------------- -[echo.js] -------------------------------- -[echo.js] 11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 -[echo.js] -------------------------------- -[echo.js] -------------------------------- -[echo.js] 12121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212 -[echo.js] -------------------------------- -[echo.js] -------------------------------- -[echo.js] 13131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313131313 -[echo.js] -------------------------------- -[echo.js] -------------------------------- -[echo.js] 14141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414141414 -[echo.js] -------------------------------- -[echo.js] -------------------------------- -[echo.js] 15151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515151515 -[echo.js] -------------------------------- -[echo.js] -------------------------------- -[echo.js] 16161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616161616 -[echo.js] -------------------------------- -[echo.js] -------------------------------- -[echo.js] 17171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717171717 -[echo.js] -------------------------------- -[echo.js] -------------------------------- -[echo.js] 18181818181818181818181818181818181818181818181818181818181818181818181818181818181818181818181818181818181818181818181818181818181818181818181818181818181818181818181818181818181818181818181818181818 -[echo.js] -------------------------------- -[echo.js] -------------------------------- -[echo.js] 19191919191919191919191919191919191919191919191919191919191919191919191919191919191919191919191919191919191919191919191919191919191919191919191919191919191919191919191919191919191919191919191919191919 -[echo.js] -------------------------------- -[echo.js] -------------------------------- -[echo.js] 20202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020 -[echo.js] -------------------------------- -[echo.js] -------------------------------- -[echo.js] 21212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121212121 -[echo.js] -------------------------------- -[echo.js] -------------------------------- -[echo.js] 22222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222 -[echo.js] -------------------------------- -[echo.js] -------------------------------- -[echo.js] 23232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323232323 -[echo.js] -------------------------------- -[echo.js] -------------------------------- -[echo.js] 24242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424242424 -[echo.js] -------------------------------- -[echo.js] -------------------------------- -[echo.js] 25252525252525252525252525252525252525252525252525252525252525252525252525252525252525252525252525252525252525252525252525252525252525252525252525252525252525252525252525252525252525252525252525252525 -[echo.js] -------------------------------- -[echo.js] -------------------------------- -[echo.js] 26262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626262626 -[echo.js] -------------------------------- -[echo.js] -------------------------------- -[echo.js] 27272727272727272727272727272727272727272727272727272727272727272727272727272727272727272727272727272727272727272727272727272727272727272727272727272727272727272727272727272727272727272727272727272727 -[echo.js] -------------------------------- -[echo.js] -------------------------------- -[echo.js] 28282828282828282828282828282828282828282828282828282828282828282828282828282828282828282828282828282828282828282828282828282828282828282828282828282828282828282828282828282828282828282828282828282828 -[echo.js] -------------------------------- -[echo.js] -------------------------------- -[echo.js] 29292929292929292929292929292929292929292929292929292929292929292929292929292929292929292929292929292929292929292929292929292929292929292929292929292929292929292929292929292929292929292929292929292929 -[echo.js] -------------------------------- -[echo.js] -------------------------------- -[echo.js] 30303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030 -[echo.js] -------------------------------- -[build.js] main process end - ---- -vt run: cache hit. diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/replay-logs-chronological-order/vite-task.json b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/replay-logs-chronological-order/vite-task.json deleted file mode 100644 index d548edfa..00000000 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/replay-logs-chronological-order/vite-task.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "cache": true -} diff --git a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-select/snapshots.toml b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-select/snapshots.toml index 3400050e..078e4414 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-select/snapshots.toml +++ b/crates/vite_task_bin/tests/e2e_snapshots/fixtures/task-select/snapshots.toml @@ -242,7 +242,10 @@ steps = [["vt", "run", "run-typo-task"]] name = "interactive ctrl-c cancels" cwd = "packages/app" steps = [ - { command = "vt run", interactions = [ + { argv = [ + "vt", + "run", + ], interactions = [ { "expect-milestone" = "task-select::0" }, { "write-key" = "ctrl-c" }, ] }, diff --git a/crates/vite_task_bin/tests/e2e_snapshots/main.rs b/crates/vite_task_bin/tests/e2e_snapshots/main.rs index bb7a0c93..6830791b 100644 --- a/crates/vite_task_bin/tests/e2e_snapshots/main.rs +++ b/crates/vite_task_bin/tests/e2e_snapshots/main.rs @@ -92,14 +92,14 @@ impl Step { fn interactions(&self) -> &[Interaction] { match self { Self::Detailed(config) => &config.interactions, - _ => &[], + Self::Simple(_) => &[], } } fn envs(&self) -> &[(Str, Str)] { match self { Self::Detailed(config) => &config.envs, - _ => &[], + Self::Simple(_) => &[], } } }