mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2024-12-18 20:47:54 +00:00
test(cover): Report coverage even on tests failure
Useful to compare coverage changes when running the full test suite under Python 3 while porting.
This commit is contained in:
parent
df69ca8b5b
commit
a6c50160e3
13
Makefile
13
Makefile
@ -17,8 +17,10 @@ PYTHON=python
|
||||
export PYTHON
|
||||
PYFLAKES=flake8
|
||||
export PYFLAKES
|
||||
VIRTUAL_ENV=./.tox/py27
|
||||
SOURCES=src/allmydata static misc setup.py
|
||||
APPNAME=tahoe-lafs
|
||||
TEST_SUITE=allmydata
|
||||
|
||||
|
||||
# Top-level, phony targets
|
||||
@ -31,6 +33,17 @@ default:
|
||||
## Run all tests and code reports
|
||||
test: .tox
|
||||
tox -p auto
|
||||
.PHONY: test-venv-coverage
|
||||
## Run all tests with coverage collection and reporting.
|
||||
test-venv-coverage:
|
||||
# Special handling for reporting coverage even when the test run fails
|
||||
test_exit=
|
||||
$(VIRTUAL_ENV)/bin/coverage run -m twisted.trial --rterrors --reporter=timing \
|
||||
$(TEST_SUITE) || test_exit="$$?"
|
||||
$(VIRTUAL_ENV)/bin/coverage combine
|
||||
$(VIRTUAL_ENV)/bin/coverage xml || true
|
||||
$(VIRTUAL_ENV)/bin/coverage report
|
||||
if [ ! -z "$$test_exit" ]; then exit "$$test_exit"; fi
|
||||
|
||||
# This is necessary only if you want to automatically produce a new
|
||||
# _version.py file from the current git history (without doing a build).
|
||||
|
4
tox.ini
4
tox.ini
@ -64,9 +64,7 @@ commands =
|
||||
|
||||
# measuring coverage is somewhat slower than not measuring coverage
|
||||
# so only do it on request.
|
||||
coverage: coverage run -m twisted.trial {env:TAHOE_LAFS_TRIAL_ARGS:--rterrors --reporter=timing} {posargs:{env:TEST_SUITE}}
|
||||
coverage: coverage combine
|
||||
coverage: coverage xml
|
||||
coverage: make -e TEST_SUITE={posargs:{env:TEST_SUITE}} test-venv-coverage
|
||||
|
||||
|
||||
[testenv:integration]
|
||||
|
Loading…
Reference in New Issue
Block a user