From eca1e96ecaad519286b1e07200b2909833718217 Mon Sep 17 00:00:00 2001 From: re:fi.64 Date: Wed, 22 Jul 2026 01:43:19 +0000 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(s) changed, 2 insertion(s)(+), 2 deletion(s)(-) diff --git a/spindle/engines/microvm/test-spindle-microvm.sh b/spindle/engines/microvm/test-spindle-microvm.sh --- a/spindle/engines/microvm/test-spindle-microvm.sh +++ b/spindle/engines/microvm/test-spindle-microvm.sh @@ -139,7 +139,7 @@ } skip_test() { echo "skipped: $*" - return "$SKIP_TEST_RC" + exit "$SKIP_TEST_RC" } host_is_nixos() { @@ -391,7 +391,7 @@ start=$(get_time_ms) 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=$? -- tangled.sh