Fixed `run_tests`

This commit is contained in:
Fabio Manganiello 2023-05-04 00:31:03 +02:00
parent 2175a6baf5
commit 592f605cad
1 changed files with 5 additions and 2 deletions

View File

@ -2,9 +2,8 @@
BASE_DIR="$(mktemp -d '/tmp/platypush-ci-tests-XXXXX')" BASE_DIR="$(mktemp -d '/tmp/platypush-ci-tests-XXXXX')"
VENV_DIR="$BASE_DIR/venv" VENV_DIR="$BASE_DIR/venv"
REPO_DIR="$BASE_DIR/repo" REPO_DIR="/opt/repos/platypush"
TEST_LOG="$BASE_DIR/test.log" TEST_LOG="$BASE_DIR/test.log"
REPO_URL=https://git.platypush.tech/platypush/platypush.git
cleanup() { cleanup() {
echo "Cleaning up environment" echo "Cleaning up environment"
@ -21,11 +20,14 @@ prepare_venv() {
install_repo() { install_repo() {
echo "Installing latest version of the repository" echo "Installing latest version of the repository"
cd "$REPO_DIR"
pip install '.[http]' pip install '.[http]'
cd -
} }
run_tests() { run_tests() {
echo "Running tests" echo "Running tests"
cd "$REPO_DIR"
pytest 2>&1 | tee "$TEST_LOG" pytest 2>&1 | tee "$TEST_LOG"
deactivate deactivate
@ -34,6 +36,7 @@ run_tests() {
return 2 # FAILURE return 2 # FAILURE
fi fi
cd -
return 0 # PASSED return 0 # PASSED
} }