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
This commit is contained in:
Jeremy Stanley 2015-04-07 18:31:40 +00:00
parent b1326d4490
commit 3562f7cc2e
2 changed files with 5 additions and 5 deletions

View File

@ -1,7 +1,7 @@
[run] [run]
branch = True branch = True
source = heat-translator source = translator
omit = heat-translator/tests/*,heat-translator/openstack/* omit = translator/openstack/*
[report] [report]
ignore-errors = True ignore-errors = True

View File

@ -10,7 +10,7 @@ setenv =
VIRTUAL_ENV={envdir} VIRTUAL_ENV={envdir}
deps = -r{toxinidir}/requirements.txt deps = -r{toxinidir}/requirements.txt
-r{toxinidir}/test-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] [testenv:pep8]
commands = flake8 commands = flake8
@ -19,7 +19,7 @@ commands = flake8
commands = {posargs} commands = {posargs}
[testenv:cover] [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] [testenv:docs]
commands = python setup.py build_sphinx commands = python setup.py build_sphinx