tests: Fix coverage reporting

Coverage reporting wasn't migrated into the docker container and
therefore did nothing at all.
This commit is contained in:
Tomas Janousek 2020-06-30 01:52:30 +02:00 committed by Tomas Babej
parent f0cc8b3ba8
commit 7663a58793
4 changed files with 13 additions and 17 deletions

View file

@ -1,6 +1,3 @@
[report]
omit = */python2.7/*,*/test*,*/__init__.py
[paths]
source =
.
/root/.vim/bundle/taskwiki
[run]
source = taskwiki
data_file = /tmp/taskwiki-coverage/.coverage

View file

@ -8,21 +8,11 @@ env:
- TASK_VERSION=v2.4.4
- TASK_VERSION=v2.5.0
- TASK_VERSION=v2.5.1
python:
- "3.6"
services:
- docker
install:
# Install coverage dependencies
- pip install coverage coveralls
# Build the docker container
- pushd $TRAVIS_BUILD_DIR
- docker-compose build --build-arg TASK_VERSION=$TASK_VERSION tests
script:
- make test
after_success:
- ls /tmp/taskwiki-coverage
- mv /tmp/taskwiki-coverage/.coverage.* . || echo ok
- coverage combine
- coverage report
- coveralls

View file

@ -8,5 +8,10 @@ test:
pytest:
$(PYTHON) -m pytest -vv $(PYTEST_FLAGS) tests/
cover-pytest: pytest
coverage combine
coverage report
if [ "$$TRAVIS" ]; then coveralls; fi
xvfb-%:
xvfb-run --server-args=-noreset $(MAKE) $*

View file

@ -8,6 +8,10 @@ services:
security_opt:
- label=type:container_runtime_t
tty: true
command: make xvfb-pytest
command: make xvfb-cover-pytest
environment:
PYTEST_FLAGS: "-o cache_dir=/tmp/pytest-cache ${PYTEST_FLAGS:-}"
TRAVIS:
TRAVIS_JOB_ID:
TRAVIS_BRANCH:
TRAVIS_PULL_REQUEST: