2022-05-04 10:08:48 +02:00
|
|
|
#!/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"
|
2022-05-04 10:19:28 +02:00
|
|
|
wraperr pip install -r requirements.dev.txt
|
2022-05-04 10:08:48 +02:00
|
|
|
|
|
|
|
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
|
|
|
|
|