diff --git a/.gitignore b/.gitignore index 5012e9901b15ec08f54008560f7e133e52a7ed06..37d2607739988817156fb18bcbd931a0c172e82e 100644 --- a/.gitignore +++ b/.gitignore @@ -29,6 +29,8 @@ AUTHORS ChangeLog doc/build etc/kolla/kolla-build.conf +.coverage +cover/ # Files generated by Vagrant dev/vagrant/Vagrantfile.custom diff --git a/test-requirements.txt b/test-requirements.txt index 4fb167d9dcb340c0f7ba91edb03f0f17e807a583..296f99d9f745c4d1b752043472c3e7737cd79e7d 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -4,6 +4,7 @@ bandit>=1.1.0 # Apache-2.0 bashate>=0.2 # Apache-2.0 beautifulsoup4 # MIT +coverage>=4.0 # Apache-2.0 doc8 # Apache-2.0 extras # MIT graphviz!=0.5.0,>=0.4.0 # MIT License diff --git a/tox.ini b/tox.ini index 89fc377c4a7b4b143b0257829b939d74b2e99d34..2241814bafa493038c93b828eba177d2bfdaf483 100644 --- a/tox.ini +++ b/tox.ini @@ -21,6 +21,14 @@ commands = [testenv:debug] commands = oslo_debug_helper {posargs} +[testenv:cover] +setenv = VIRTUAL_ENV={envdir} + NOSE_WITH_COVERAGE=1 + NOSE_COVER_BRANCHES=1 + NOSE_COVER_HTML=1 + NOSE_COVER_HTML_DIR={toxinidir}/cover +commands = python setup.py testr --coverage --testr-args='{posargs}' + [testenv:pep8] commands = {toxinidir}/tools/run-bashate.sh