From cef5b11996c6c2fef6b7ed1a7e6859aa5bd67da6 Mon Sep 17 00:00:00 2001 From: Ronald Bradford Date: Thu, 1 Oct 2015 09:54:29 -0400 Subject: [PATCH] Fix coverage configuration and execution A number of configuration errors prevent the successful creation of code coverage. This corrects the .coveragerc source/omit setup and the tox package name generation. http://lists.openstack.org/pipermail/openstack-dev/2015-October/076193.html Change-Id: If0f21e37a5d9b43c0f9491d306167d2656c137f9 --- .coveragerc | 5 +++-- .gitignore | 3 ++- tox.ini | 4 ++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.coveragerc b/.coveragerc index 2b1cde0..d9145d4 100644 --- a/.coveragerc +++ b/.coveragerc @@ -1,7 +1,8 @@ [run] branch = True -source = serialization -omit = serialization/tests/*,serialization/openstack/* +source = oslo_serialization +omit = oslo_serialization/tests/* [report] ignore_errors = True +precision = 2 diff --git a/.gitignore b/.gitignore index 1399c98..ed88334 100644 --- a/.gitignore +++ b/.gitignore @@ -23,6 +23,7 @@ pip-log.txt # Unit test / coverage reports .coverage +cover .tox nosetests.xml .testrepository @@ -48,4 +49,4 @@ ChangeLog # Editors *~ -.*.swp \ No newline at end of file +.*.swp diff --git a/tox.ini b/tox.ini index 9933b48..45d6b63 100644 --- a/tox.ini +++ b/tox.ini @@ -26,7 +26,7 @@ commands = {posargs} commands = python setup.py build_sphinx [testenv:cover] -commands = python setup.py testr --coverage --testr-args='{posargs}' +commands = python setup.py test --coverage --coverage-package-name=oslo_serialization --testr-args='{posargs}' [flake8] # H803 skipped on purpose per list discussion. @@ -42,4 +42,4 @@ exclude=.venv,.git,.tox,dist,doc,*openstack/common*,*lib/python*,*egg,build # this also means that pip-missing-reqs must be installed separately, outside # of the requirements.txt files deps = pip_missing_reqs -commands = pip-missing-reqs -d --ignore-module=oslo_serialization* --ignore-module=pkg_resources --ignore-file=oslo_serialization/test.py --ignore-file=oslo_serialization/tests/* oslo_serialization \ No newline at end of file +commands = pip-missing-reqs -d --ignore-module=oslo_serialization* --ignore-module=pkg_resources --ignore-file=oslo_serialization/test.py --ignore-file=oslo_serialization/tests/* oslo_serialization