From 91ab8de870506d9d98bc0231eb5a98e18585a797 Mon Sep 17 00:00:00 2001 From: Al Bailey Date: Tue, 20 Nov 2018 14:45:02 -0600 Subject: [PATCH] Fix coverage reporting for stx-distcloud-client tox -e cover was not working, and now it is Coverage runs successfully in python3. Current coverage is 64% Story: 2003862 Task: 28017 Change-Id: Iedd821d889550f63014187c7d6ec51580533a2e2 Signed-off-by: Al Bailey --- .gitignore | 3 ++- tox.ini | 14 +++++++++++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 963e589..e621e98 100644 --- a/.gitignore +++ b/.gitignore @@ -27,6 +27,7 @@ cover/ !.coveragerc .tox nosetests.xml +.stestr .testrepository .venv @@ -55,4 +56,4 @@ ChangeLog .*sw? # Files created by releasenotes build -releasenotes/build \ No newline at end of file +releasenotes/build diff --git a/tox.ini b/tox.ini index 2ab103d..0f39234 100644 --- a/tox.ini +++ b/tox.ini @@ -38,7 +38,19 @@ commands = {posargs} [testenv:cover] basepython = python3 -commands = python setup.py test --coverage --testr-args='{posargs}' +setenv = + PYTHON=coverage run --parallel-mode + PYTHONDONTWRITEBYTECODE=True + +deps = {[testenv]deps} + coverage + +commands = + find {toxinidir} -not -path '{toxinidir}/.tox/*' -name '*.py[c|o]' -delete + coverage erase + stestr --test-path={[dcclient]client_base_dir}/dcmanagerclient/tests run '{posargs}' + coverage combine + coverage report [testenv:debug] basepython = python3