From 170c0a9eb2d7822457a65d2ff6b174f01fd037e0 Mon Sep 17 00:00:00 2001 From: Ben Nemec Date: Mon, 30 Nov 2015 22:20:31 +0000 Subject: [PATCH] Make coverage tests work The default package name for coverage doesn't work, so we need to explicitly state it in tox.ini. We should also exclude the tests directory as that code will typically be 100% tested, and if it's not we don't really care. Also excludes the coverage results from git so it doesn't show up in git status. Change-Id: I9e99b2c7c215a5de3c76cb2daf0f468f445774c3 --- .coveragerc | 2 +- .gitignore | 1 + tox.ini | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.coveragerc b/.coveragerc index 33f5b562b..cc11b498d 100644 --- a/.coveragerc +++ b/.coveragerc @@ -1,7 +1,7 @@ [run] branch = True source = tripleo_common -omit = tripleo_common/openstack/* +omit = tripleo_common/tests/* [report] ignore_errors = True diff --git a/.gitignore b/.gitignore index 8a3c70429..af8f1342b 100644 --- a/.gitignore +++ b/.gitignore @@ -23,6 +23,7 @@ pip-log.txt # Unit test / coverage reports .coverage +cover .tox nosetests.xml .testrepository diff --git a/tox.ini b/tox.ini index a0301e70a..a17e8fc61 100644 --- a/tox.ini +++ b/tox.ini @@ -19,7 +19,7 @@ commands = flake8 commands = {posargs} [testenv:cover] -commands = python setup.py test --coverage --testr-args='{posargs}' +commands = python setup.py test --coverage --coverage-package-name=tripleo_common --testr-args='{posargs}' [testenv:docs] commands = python setup.py build_sphinx