From 9be456a4ef642c0799b9fb2ec44a7b3dda44f8af Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Sun, 19 Sep 2021 23:28:05 +0200 Subject: [PATCH] Simplified run_ci_tests.sh to run within a Gitlab runner context --- bin/run_ci_tests.sh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/bin/run_ci_tests.sh b/bin/run_ci_tests.sh index d2a51cf..b896a21 100755 --- a/bin/run_ci_tests.sh +++ b/bin/run_ci_tests.sh @@ -1,6 +1,6 @@ #!/bin/bash -BASE_DIR="$(mktemp -d)" +BASE_DIR="$(mktemp -d '/tmp/platypush-ci-tests-XXXXX')" VENV_DIR="$BASE_DIR/venv" REPO_DIR="$BASE_DIR/repo" TEST_LOG="$BASE_DIR/test.log" @@ -16,19 +16,18 @@ prepare_venv() { python -m venv "$VENV_DIR" cd "$VENV_DIR" source ./bin/activate + cd - } install_repo() { echo "Installing latest version of the repository" - git clone "$REPO_URL" "$REPO_DIR" - cd "$REPO_DIR" pip install '.[http]' } run_tests() { echo "Running tests" - cd "$REPO_DIR" pytest 2>&1 | tee "$TEST_LOG" + grep -e '^FAILED ' "$TEST_LOG" if [[ $? == 0 ]]; then return 2 # FAILURE