britney2-ubuntu/ci/gitlab-ci-runner
Niels Thykier 3d076d9bb0 .gitlab-ci.yml: Run tests with coverage on gitlab
Signed-off-by: Niels Thykier <niels@thykier.net>
2018-06-05 13:39:47 +00:00

27 lines
557 B
Bash
Executable File

#!/bin/bash
set -e
err=0
PYTEST_COV_OPTIONS=
BRITNEY=./britney.py
git clone https://salsa.debian.org/debian/britney2-tests.git britney2-tests
if [ "x$1" = "x--with-coverage" ]; then
PYTEST_COV_OPTIONS="--cov-branch --cov --cov-report="
BRITNEY=./ci/britney-coverage.sh
fi
py.test-3 -v $PYTEST_COV_OPTIONS || err=$?
echo
britney2-tests/bin/runtests "$BRITNEY" britney2-tests/t test-out || err=$?
if [ $err = 0 ] && [ "x$1" = "x--with-coverage" ]; then
python3-coverage report -m
echo
python3-coverage html -d coverage
fi
exit $err