Skip to content
Snippets Groups Projects
Commit 9c761869 authored by Corné Lukken's avatar Corné Lukken
Browse files

L2SS-313: Resolve access to coverage as module

parent 7395aac2
No related branches found
No related tags found
1 merge request!207Resolve L2SS-313
......@@ -22,6 +22,7 @@ tangostationcontrol/dist
tangostationcontrol/docs/build
**/coverage.xml
**/.coverage
**/.ipynb_checkpoints
**/pending_log_messages.db
**/.eggs
......
......@@ -26,19 +26,31 @@ setenv = TESTS_DIR=./tangostationcontrol/integration_test
commands =
stestr run --serial {posargs}
; The access to coverage as module is a bit of an ugly hack. This is due to
; cover inheriting testenv which has `sitepackages = True`, meaning that global
; packages can be accessed by the tox environment. Our tango images already have
; coverage system wide installed, however, the system wide installation will
; never look inside tox its virtualenv for packages. So accessing stestr and
; others fail.. We can't remove `sitepackages = True` either as we need access
; to tango and installing this package is non-trivial. The solution is to
; prevent calling binaries directly and utilizing python to resolve the
; requested module. In addition stestr does not natively support generating
; coverage reports which is where the `PYTHON=python -m coverage run....` comes
; from.
[testenv:cover]
allowlist_externals =
coverage
setenv =
VIRTUAL_ENV={envdir}
PYTHON=python -m coverage run --source tangostationcontrol --parallel-mode
deps =
-r{toxinidir}/test-requirements.txt
-r{toxinidir}/../docker-compose/lofar-device-base/lofar-requirements.txt
commands =
coverage erase
stestr run {posargs}
coverage combine
coverage html -d cover
coverage xml -o coverage.xml
coverage report
python -m coverage erase
stestr run {posargs}
python -m coverage combine
python -m coverage html -d cover
python -m coverage xml -o coverage.xml
python -m coverage report
; TODO(Corne): Integrate Hacking to customize pep8 rules
[testenv:pep8]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment