mirror of
https://git.launchpad.net/~ubuntu-release/britney/+git/britney2-ubuntu
synced 2025-05-23 08:21:30 +00:00
.gitlab-ci.yml: Run tests with coverage on gitlab
Signed-off-by: Niels Thykier <niels@thykier.net>
This commit is contained in:
parent
28953b2224
commit
3d076d9bb0
@ -1,10 +1,21 @@
|
|||||||
#tests-stretch:
|
tests-stretch:
|
||||||
# image: debian:stretch
|
stage: test
|
||||||
# script: debian/run-ci
|
image: debian:stretch
|
||||||
|
script:
|
||||||
|
- apt-get update
|
||||||
|
- apt-get install -y python3 python3-apt python3-yaml python3-pytest git rsync libclass-accessor-perl libdpkg-perl
|
||||||
|
- ci/gitlab-ci-runner
|
||||||
|
|
||||||
#tests-sid:
|
tests-sid:
|
||||||
# image: debian:sid
|
stage: test
|
||||||
# script: debian/run-ci
|
image: debian:sid
|
||||||
|
script:
|
||||||
|
- apt-get update
|
||||||
|
- apt-get install -y python3 python3-apt python3-yaml python3-coverage python3-pytest python3-pytest-cov git rsync libclass-accessor-perl libdpkg-perl
|
||||||
|
- ci/gitlab-ci-runner --with-coverage
|
||||||
|
artifacts:
|
||||||
|
paths:
|
||||||
|
- coverage
|
||||||
|
|
||||||
docs:
|
docs:
|
||||||
stage: test
|
stage: test
|
||||||
@ -22,10 +33,12 @@ pages:
|
|||||||
stage: deploy
|
stage: deploy
|
||||||
dependencies:
|
dependencies:
|
||||||
- docs
|
- docs
|
||||||
|
- tests-sid
|
||||||
script:
|
script:
|
||||||
- rm -fr public
|
- rm -fr public
|
||||||
- mkdir public
|
- mkdir public
|
||||||
- mv docs public/docs
|
- mv docs public/docs
|
||||||
|
- mv coverage public/coverage
|
||||||
artifacts:
|
artifacts:
|
||||||
paths:
|
paths:
|
||||||
- public
|
- public
|
||||||
|
26
ci/gitlab-ci-runner
Executable file
26
ci/gitlab-ci-runner
Executable file
@ -0,0 +1,26 @@
|
|||||||
|
#!/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
|
Loading…
x
Reference in New Issue
Block a user