aboutsummaryrefslogtreecommitdiff
path: root/scripts/testing
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-06-25 23:24:04 -0400
committerCraig Jennings <c@cjennings.net>2026-06-25 23:24:04 -0400
commitfb495d454edc3c2abac572d2e007f287fa2675e7 (patch)
treec45306bae80c16fc4235a2eabd5e3f3705050496 /scripts/testing
parent771b92ef7061f230a04f26cc26b5d72a18c3060c (diff)
downloadarchsetup-fb495d454edc3c2abac572d2e007f287fa2675e7.tar.gz
archsetup-fb495d454edc3c2abac572d2e007f287fa2675e7.zip
fix(testing): keep the bare-metal runner past a failing Testinfra sweep
run-test-baremetal.sh runs under set -e, and the P-D migration left run_testinfra_validation called bare. It returns pytest's rc, so a failing sweep aborted the script before it wrote the report or the TEST FAILED summary. The old run_all_validations returned 0 and never tripped set -e. Mirror the VM runner: set +e around the call, capture the rc, and derive TEST_PASSED from it so the report and summary always run.
Diffstat (limited to 'scripts/testing')
-rwxr-xr-xscripts/testing/run-test-baremetal.sh11
1 files changed, 7 insertions, 4 deletions
diff --git a/scripts/testing/run-test-baremetal.sh b/scripts/testing/run-test-baremetal.sh
index d040768..d22c424 100755
--- a/scripts/testing/run-test-baremetal.sh
+++ b/scripts/testing/run-test-baremetal.sh
@@ -265,9 +265,12 @@ fi
# Run validations. Testinfra is the authoritative validator (same as the VM
# runner); its ZFS-conditional pytest checks cover what validate_zfs_services
-# used to. It surfaces pass/fail through the VALIDATION_* counters the
-# TEST_PASSED check below reads, and connects over the key authorized above.
+# used to, and it connects over the key authorized above. set +e because it
+# returns pytest's rc (non-zero on failures) and the report + summary below must
+# still run; the verdict is carried by testinfra_rc and the exit code at the end.
+set +e
run_testinfra_validation "$TEST_RESULTS_DIR"
+testinfra_rc=$?
# Analyze logs if we ran archsetup
if ! $VALIDATE_ONLY; then
@@ -277,8 +280,8 @@ fi
# Generate reports
generate_issue_report "$TEST_RESULTS_DIR" "$ARCHZFS_INBOX"
-# Set validation result (TEST_PASSED is the boolean; VALIDATION_PASSED stays the counter)
-if [ "$VALIDATION_FAILED" -eq 0 ]; then
+# The run passes only if the Testinfra sweep passed.
+if [ "$testinfra_rc" -eq 0 ]; then
TEST_PASSED=true
else
TEST_PASSED=false