Skip to content

Commit 77369a2

Browse files
committed
test(pacquet/cli): assert recursive run/exec don't dispatch on a rejected selector
Strengthen the `[<since>]` diff-selector regression tests so they prove the command short-circuits before dispatch, not merely that stderr names the error. `run` asserts the build script's `ran.txt` marker is absent, and `exec` now runs a marker-writing command (`touch ran.txt`) and asserts the marker is absent. Per REVIEW_GUIDE.md, regression assertions must observe the changed behavior rather than only the error message. Refs #12723
1 parent a261da7 commit 77369a2

2 files changed

Lines changed: 10 additions & 1 deletion

File tree

pacquet/crates/cli/tests/exec_recursive.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,8 @@ fn recursive_exec_diff_selector_is_unsupported() {
147147
.with_arg("--filter")
148148
.with_arg("[main]")
149149
.with_arg("exec")
150-
.with_arg("true")
150+
.with_arg("touch")
151+
.with_arg("ran.txt")
151152
.output()
152153
.expect("spawn pacquet");
153154
assert!(!output.status.success(), "a [<since>] diff selector is unsupported and must fail");
@@ -156,6 +157,10 @@ fn recursive_exec_diff_selector_is_unsupported() {
156157
stderr.contains("Changed-package filter selectors"),
157158
"stderr should explain the diff selector is unsupported, got: {stderr}",
158159
);
160+
assert!(
161+
!workspace.join("project-1").join("ran.txt").exists(),
162+
"exec must reject the selector before dispatching the command, so no marker is written",
163+
);
159164

160165
drop(root);
161166
}

pacquet/crates/cli/tests/run_recursive.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -473,6 +473,10 @@ fn recursive_run_diff_selector_is_unsupported() {
473473
stderr.contains("Changed-package filter selectors"),
474474
"stderr should explain the diff selector is unsupported, got: {stderr}",
475475
);
476+
assert!(
477+
!workspace.join("project-1").join("ran.txt").exists(),
478+
"run must reject the selector before invoking the build script, so no marker is written",
479+
);
476480

477481
drop(root);
478482
}

0 commit comments

Comments
 (0)