Omit tests from code coverage run

Fine-tune the coverage results by:
  - Omitting the tests folder from the coverage run.
  - Added report generation of coverage on the console while tox
    target run.
  - Removed and consolidated duplicate switches from run/report
    commands inside .coveragerc file, which was already present.

Change-Id: I5c44e73768487eaefebf95f1dd026ba99b90a04c
This commit is contained in:
Debayan Ray
2018-09-25 07:13:40 +00:00
parent ec6e6c1df1
commit 7ee490cc0a
2 changed files with 7 additions and 2 deletions

View File

@ -1,9 +1,13 @@
[run] [run]
branch = True branch = True
source = sushy source = sushy
omit =
*tests*
[report] [report]
ignore_errors = True ignore_errors = True
omit =
*tests*
[html] [html]
directory = cover directory = cover

View File

@ -27,14 +27,15 @@ commands = {posargs}
basepython = python3 basepython = python3
setenv = setenv =
{[testenv]setenv} {[testenv]setenv}
PYTHON=coverage run --source sushy --parallel-mode PYTHON=coverage run --parallel-mode
# After running this target, visit sushy/cover/index.html # After running this target, visit sushy/cover/index.html
# in your browser, to see a nicer presentation report with annotated # in your browser, to see a nicer presentation report with annotated
# HTML listings detailing missed lines. # HTML listings detailing missed lines.
commands = coverage erase commands = coverage erase
stestr run {posargs} stestr run {posargs}
coverage combine coverage combine
coverage html -d cover coverage report
coverage html
coverage xml -o cover/coverage.xml coverage xml -o cover/coverage.xml
[testenv:docs] [testenv:docs]