repo-cloner/ci/docker/run-tests
Václav Valíček ab9d635b49
Fix misstyped dot
Signed-off-by: Václav Valíček <valicek1994@gmail.com>
2022-05-04 10:13:54 +02:00

51 lines
975 B
Bash
Executable File

#!/bin/bash
set -euo pipefail
IFS=$'\n\t'
# source cli lib
source /usr/local/clilib
status "Preparing XDG_RUNTIME_DIR"
export XDG_RUNTIME_DIR=/tmp/xdg-runtime-dir
mkdir -p $XDG_RUNTIME_DIR
# setup exit trap
function finish {
status "Changing ownership of /app directory"
perms=$(stat -c '%u:%g' /app)
wraperr chown -R $perms /app
}
trap finish EXIT
status "Loading venv"
source /venv/bin/activate
echo $VIRTUAL_ENV
status "Changing directory to /app"
wraperr cd /app
status "Installing pip depenencies"
wraperr pip install -r requirements.txt
status "Installing dev dependencies"
wraperr pip install -r requirements.dev
# TODO: fix later
exit 0
status "Preparing data trees for tests..."
wraperr bash -c "cd tests/_support_data; ./gen-data.sh"
status "Running tests itself"
wraperr python3 -m pytest .\
-v \
-n auto \
--ignore=tests/_support_data \
--color=yes \
--cov . \
--cov-config .coveragerc \
--cov-report term-missing \
--cov-report html
exit 0