There is an out-of-sync approach regarding the location of the results
folder: some scripts refer to it via $CI_PROJECT_DIR/results, while
others just assume it is located in the current working directory.
Usually $PWD points to $CI_PROJECT_DIR, but in some cases this is not
the case, hence let's ensure the 'results' folder can always be found
in the current working directory.
Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
Reviewed-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15208>
export DISPLAY=:0
fi
-RESULT=fail
-if sh $HWCI_TEST_SCRIPT; then
- RESULT=pass
- rm -rf results/trace/$PIGLIT_REPLAY_DEVICE_NAME
-fi
+sh "$HWCI_TEST_SCRIPT" && RESULT=pass || RESULT=fail
+
+# 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
# upload artifacts
MINIO=$(cat /proc/cmdline | tr ' ' '\n' | grep minio_results | cut -d '=' -f 2 || true)