From c07b0093d825c8e302b5a6bc3b25418ff415bf4e Mon Sep 17 00:00:00 2001 From: Georgia Garcia Date: Thu, 8 May 2025 09:55:52 -0300 Subject: [PATCH] spread: improve error message when regression test is missing Due to how the debug information shows up when something fails in spread the information is hard to figure out. See this example when the allow_all test was missing https://gitlab.com/apparmor/apparmor/-/jobs/9958642493 Signed-off-by: Georgia Garcia --- spread.yaml | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/spread.yaml b/spread.yaml index 41f21da80..9c619912a 100644 --- a/spread.yaml +++ b/spread.yaml @@ -276,17 +276,20 @@ suites: echo '$(foreach t,$(TESTS),$(info TEST/$t))' | \ make -n -f "$SPREAD_PATH"/tests/regression/apparmor/Makefile -f /dev/stdin | \ grep -F TEST/ | \ - cut -d / -f 2 | \ - tee apparmor-regression-tests.txt + cut -d / -f 2 > apparmor-regression-tests.txt fail=0 + missing_tests=() while read -r V; do - if ! grep -xF ' TEST/'"$V"': 1' "$SPREAD_PATH"/tests/regression/apparmor/task.yaml; then - echo "tests/regression/task.yaml: missing test variant: TEST/$V" >&2 + if ! grep -xqF ' TEST/'"$V"': 1' "$SPREAD_PATH"/tests/regression/apparmor/task.yaml; then + missing_tests+=("tests/regression/task.yaml: missing test variant: TEST/$V") fail=1 fi done &2 + echo "exiting due to missing variants:" >&2 + for msg in "${missing_tests[@]}"; do + echo "$msg" >&2 + done exit 1 fi