From eca1e96ecaad519286b1e07200b2909833718217 Mon Sep 17 00:00:00 2001 From: "re:fi.64" Date: Tue, 21 Jul 2026 20:43:19 -0500 Subject: [PATCH] spindle: fix skipped tests not actually being skipped `if` effectively neuters `set -e`: ``` $ bash -c 'set -ex; f() { false; echo 123; }; if f; then echo 456; fi' + f + false + echo 123 123 + echo 456 456 ``` so the test keeps on running. Instead, we can rely on `exit` (which is not going to break as easily) + a subshell to make sure we actually catch error codes. (This might also cause other forms of test "failure" to not get detected, as well.) --- spindle/engines/microvm/test-spindle-microvm.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spindle/engines/microvm/test-spindle-microvm.sh b/spindle/engines/microvm/test-spindle-microvm.sh index 308e5a01..68e2ee73 100755 --- a/spindle/engines/microvm/test-spindle-microvm.sh +++ b/spindle/engines/microvm/test-spindle-microvm.sh @@ -139,7 +139,7 @@ print_summary() { skip_test() { echo "skipped: $*" - return "$SKIP_TEST_RC" + exit "$SKIP_TEST_RC" } host_is_nixos() { @@ -391,7 +391,7 @@ run_test_job() { log "[$name] start (vsock port $port)" local status="Passed" - if "$func" > "$logfile" 2>&1; then + if ("$func") > "$logfile" 2>&1; then status="Passed" else local rc=$? -- 2.51.2