From 7ee490cc0a3606b25cdd962c8f50e9d45bebee9c Mon Sep 17 00:00:00 2001 From: Debayan Ray Date: Tue, 25 Sep 2018 07:13:40 +0000 Subject: [PATCH] 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 --- .coveragerc | 4 ++++ tox.ini | 5 +++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.coveragerc b/.coveragerc index 3532cb58..0affbccd 100644 --- a/.coveragerc +++ b/.coveragerc @@ -1,9 +1,13 @@ [run] branch = True source = sushy +omit = + *tests* [report] ignore_errors = True +omit = + *tests* [html] directory = cover diff --git a/tox.ini b/tox.ini index f2a14fe8..3e8e90b6 100644 --- a/tox.ini +++ b/tox.ini @@ -27,14 +27,15 @@ commands = {posargs} basepython = python3 setenv = {[testenv]setenv} - PYTHON=coverage run --source sushy --parallel-mode + PYTHON=coverage run --parallel-mode # After running this target, visit sushy/cover/index.html # in your browser, to see a nicer presentation report with annotated # HTML listings detailing missed lines. commands = coverage erase stestr run {posargs} coverage combine - coverage html -d cover + coverage report + coverage html coverage xml -o cover/coverage.xml [testenv:docs]