diff --git a/.coveragerc b/.coveragerc new file mode 100644 index 00000000..8a9ce0c2 --- /dev/null +++ b/.coveragerc @@ -0,0 +1,7 @@ +[run] +branch = True +source = deckhand +omit = deckhand/tests/* + +[report] +ignore_errors = True \ No newline at end of file diff --git a/.gitignore b/.gitignore index 188f0211..dee2eb72 100644 --- a/.gitignore +++ b/.gitignore @@ -24,7 +24,6 @@ wheels/ *.egg-info/ .installed.cfg *.egg -etc/*.sample # PyInstaller # Usually these files are written by a python script from a template @@ -47,6 +46,7 @@ coverage.xml *.cover .hypothesis/ .testrepository/* +cover/* # Translations *.mo diff --git a/test-requirements.txt b/test-requirements.txt index 5e85168c..e6663379 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -7,6 +7,8 @@ hacking!=0.13.0,<0.14,>=0.12.0 # Apache-2.0 falcon==1.1.0 +hacking!=0.13.0,<0.14,>=0.12.0 # Apache-2.0 +coverage!=4.4,>=4.0 # Apache-2.0 mock>=2.0 fixtures>=3.0.0 # Apache-2.0/BSD mox3!=0.19.0,>=0.7.0 # Apache-2.0 diff --git a/tox.ini b/tox.ini index 462fc91f..9f409501 100644 --- a/tox.ini +++ b/tox.ini @@ -38,6 +38,13 @@ commands = find . -type f -name "*.pyc" -delete ostestr '{posargs}' +[testenv:cover] +commands = + coverage erase + find . -type f -name "*.pyc" -delete + python setup.py testr --coverage --testr-args='{posargs}' + coverage report + [testenv:genconfig] commands = oslo-config-generator --config-file=etc/deckhand/config-generator.conf