From fb2ffc2f6773606c9cda4188851514f14ca102de Mon Sep 17 00:00:00 2001 From: Cristian Ciocaltea Date: Thu, 4 Nov 2021 20:49:05 +0200 Subject: [PATCH] ci: Provide consistent results location in LAVA 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 Reviewed-by: Guilherme Gallo Reviewed-by: Tomeu Vizoso Part-of: --- .gitlab-ci/common/init-stage2.sh | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.gitlab-ci/common/init-stage2.sh b/.gitlab-ci/common/init-stage2.sh index b9eb8b57e80..baf3fc330d6 100755 --- a/.gitlab-ci/common/init-stage2.sh +++ b/.gitlab-ci/common/init-stage2.sh @@ -91,11 +91,12 @@ if [ -n "$HWCI_START_XORG" ]; then 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)