From 149af342a2d878467326ec5d76d923a2474162df Mon Sep 17 00:00:00 2001 From: Timo Wilken Date: Tue, 19 Dec 2023 11:36:03 +0100 Subject: [PATCH] Output sim challenge log during full system test This allows spotting problems from the CI log directly, without having to find sim-challenge.log on a builder. --- o2-full-system-test.sh | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/o2-full-system-test.sh b/o2-full-system-test.sh index ae40bc7b3b..f3c748d67e 100644 --- a/o2-full-system-test.sh +++ b/o2-full-system-test.sh @@ -32,16 +32,17 @@ rm -Rf $BUILDDIR/full-system-test-sim rm -Rf $BUILDDIR/sim-challenge mkdir $BUILDDIR/sim-challenge pushd $BUILDDIR/sim-challenge -SIMEXITCODE=0 -# SIM_CHALLENGE_ANATESTING=ON --> reenable when we want analysis testing be part of the tests -{ "$O2_ROOT/prodtests/sim_challenge.sh" &> sim-challenge.log; SIMEXITCODE=$?; } || true # don't quit immediately on error +# SIM_CHALLENGE_ANATESTING=ON --> reenable when we want analysis testing be part of the tests +set +o pipefail # don't exit immediately if sim_challenge.sh fails +"$O2_ROOT/prodtests/sim_challenge.sh" 2>&1 | tee sim-challenge.log +SIMEXITCODE=${PIPESTATUS[0]} result=$(grep "Return status" sim-challenge.log | grep -v ": 0" || true) -if [ ${SIMEXITCODE} != "0" ] || [ "${result}" ]; then +if [ "${SIMEXITCODE}" -ne 0 ] || [ -n "${result}" ]; then # something is wrong if we get a match here # it matches if either the return code itself was != 0 or if a reported status # in the log is not ok echo "error detected in sim_challenge" - find ./ -type f \( -name "*.log" -and ! -name "pipel*" \) -exec awk ' { print FILENAME $0 } ' {} ';' || true + find ./ -type f \( -name "*.log" -and ! -name "pipel*" \) -exec awk '{ print FILENAME, $0 }' {} ';' # make the recipe fail false else