From 3fd72266cd6e1d1ec9aa3da39fc14e2318b44ae1 Mon Sep 17 00:00:00 2001 From: Daniel Stone Date: Mon, 2 Sep 2024 11:57:06 +0100 Subject: [PATCH] ci/lava: Make it easier to run pytest locally If we don't have ${CI_PROJECT_DIR} set, just find it from where we're running the script. Signed-off-by: Daniel Stone Part-of: --- .gitlab-ci/lava/lava-pytest.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci/lava/lava-pytest.sh b/.gitlab-ci/lava/lava-pytest.sh index 786a669b917..40125bad2f6 100755 --- a/.gitlab-ci/lava/lava-pytest.sh +++ b/.gitlab-ci/lava/lava-pytest.sh @@ -6,7 +6,11 @@ # This script runs unit/integration tests related with LAVA CI tools # shellcheck disable=SC1091 # The relative paths in this file only become valid at runtime. -set -ex +set -exu + +if [ -z "${CI_PROJECT_DIR:-}" ]; then + CI_PROJECT_DIR="$(dirname "${0}")/../../" +fi # Use this script in a python virtualenv for isolation python3 -m venv .venv