summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuilherme Gallo <guilherme.gallo@collabora.com>2022-02-17 01:11:49 +0000
committerMarge Bot <emma+marge@anholt.net>2022-04-28 06:33:46 +0000
commit6a3ee3ea32336a4fb9004d4f0587d32af72ba495 (patch)
treefae2932c06b75db5ce3f2badf987f98a7aed2aad
parent43d8ed840ed697b435219a36ebd986a5113c2108 (diff)
ci/lava: Return test-suite result as exit code
Makes it easier for external observers. Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15938>
-rwxr-xr-x.gitlab-ci/common/init-stage2.sh13
1 files changed, 10 insertions, 3 deletions
diff --git a/.gitlab-ci/common/init-stage2.sh b/.gitlab-ci/common/init-stage2.sh
index 39fa2c810b8..e371228ea48 100755
--- a/.gitlab-ci/common/init-stage2.sh
+++ b/.gitlab-ci/common/init-stage2.sh
@@ -60,7 +60,6 @@ if [ "$HWCI_FREQ_MAX" = "true" ]; then
# Disable GPU runtime power management
GPU_AUTOSUSPEND=`find /sys/devices -name autosuspend_delay_ms | grep gpu | head -1`
test -z "$GPU_AUTOSUSPEND" || echo -1 > $GPU_AUTOSUSPEND || true
-
# Lock Intel GPU frequency to 70% of the maximum allowed by hardware
# and enable throttling detection & reporting.
# Additionally, set the upper limit for CPU scaling frequency to 65% of the
@@ -97,12 +96,16 @@ if [ -n "$HWCI_START_XORG" ]; then
export DISPLAY=:0
fi
-sh -c "$HWCI_TEST_SCRIPT" && RESULT=pass || RESULT=fail
+RESULT=fail
+set +e
+sh -c "$HWCI_TEST_SCRIPT"
+set -e
+EXIT_CODE=$?
# Let's make sure the results are always stored in current working directory
mv -f ${CI_PROJECT_DIR}/results ./ 2>/dev/null || true
-[ "${RESULT}" = "fail" ] || rm -rf results/trace/$PIGLIT_REPLAY_DEVICE_NAME
+[ ${EXIT_CODE} -ne 0 ] || rm -rf results/trace/"$PIGLIT_REPLAY_DEVICE_NAME"
# upload artifacts
if [ -n "$MINIO_RESULTS_UPLOAD" ]; then
@@ -111,4 +114,8 @@ if [ -n "$MINIO_RESULTS_UPLOAD" ]; then
ci-fairy minio cp results.tar.gz minio://"$MINIO_RESULTS_UPLOAD"/results.tar.gz;
fi
+# We still need to echo the hwci: mesa message, as some scripts rely on it, such
+# as the python ones inside the bare-metal folder
+[ ${EXIT_CODE} -eq 0 ] && RESULT=pass
echo "hwci: mesa: $RESULT"
+exit $EXIT_CODE