From 020939eddc2fcf092427d50eef2cae7583a484d9 Mon Sep 17 00:00:00 2001 From: BorjaEst Date: Mon, 30 Nov 2020 15:03:45 +0100 Subject: [PATCH] Add test coverage --- .gitignore | 1 + tox.ini | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/.gitignore b/.gitignore index 8a7bbd61..9a2543f0 100644 --- a/.gitignore +++ b/.gitignore @@ -47,6 +47,7 @@ htmlcov/ .cache nosetests.xml coverage.xml +cover/ *.cover *.py,cover .hypothesis/ diff --git a/tox.ini b/tox.ini index c8fb6fb3..cd0c93fa 100644 --- a/tox.ini +++ b/tox.ini @@ -24,6 +24,24 @@ commands = {[testenv]commands} stestr -v run {posargs} +[testenv:cover] +# TODO(stephenfin): Remove the PYTHON hack below in favour of a [coverage] +# section once we rely on coverage 4.3+ +# +# https://bitbucket.org/ned/coveragepy/issues/519/ +envdir = {toxworkdir}/shared +setenv = + {[testenv]setenv} + PYTHON=coverage run --source eosc_perf --parallel-mode +commands = + {[testenv]commands} + coverage erase + stestr -v run {posargs} + coverage combine + coverage html -d cover + coverage xml -o cover/coverage.xml + coverage report + [testenv:pep8] envdir = {toxworkdir}/shared commands = - flake8 --format=pylint --output-file=flake8.log