From 3562f7cc2e926a488d5a83e6b858dbf066c95afc Mon Sep 17 00:00:00 2001 From: Jeremy Stanley Date: Tue, 7 Apr 2015 18:31:40 +0000 Subject: [PATCH] Fix coverage so that it works for this repo PBR provides test and testr entrypoints, the latter of which is not recommended as its serviced directly by testr. Switch to test in tox.ini and pass an option to PBR indicating the correct package name to use when calling coverage. Also update .coveragerc with the corrected source path, and stop omitting the tests themselves (after all, tests should cover themselves!). Change-Id: I04b1a5393979c5d82a794d35189743f688bdfdd8 --- .coveragerc | 6 +++--- tox.ini | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.coveragerc b/.coveragerc index 6d3b4185..c3d111c6 100644 --- a/.coveragerc +++ b/.coveragerc @@ -1,7 +1,7 @@ [run] branch = True -source = heat-translator -omit = heat-translator/tests/*,heat-translator/openstack/* +source = translator +omit = translator/openstack/* [report] -ignore-errors = True \ No newline at end of file +ignore-errors = True diff --git a/tox.ini b/tox.ini index b5f843aa..6de0bf24 100644 --- a/tox.ini +++ b/tox.ini @@ -10,7 +10,7 @@ setenv = VIRTUAL_ENV={envdir} deps = -r{toxinidir}/requirements.txt -r{toxinidir}/test-requirements.txt -commands = python setup.py testr --slowest --testr-args='{posargs}' +commands = python setup.py test --slowest --testr-args='{posargs}' [testenv:pep8] commands = flake8 @@ -19,7 +19,7 @@ commands = flake8 commands = {posargs} [testenv:cover] -commands = python setup.py testr --coverage --testr-args='{posargs}' +commands = python setup.py test --coverage --coverage-package-name=translator --testr-args='{posargs}' [testenv:docs] commands = python setup.py build_sphinx