diff --git a/.gitignore b/.gitignore index 82f0112dd..4153f8687 100644 --- a/.gitignore +++ b/.gitignore @@ -27,6 +27,7 @@ develop-eggs # Other *.DS_Store .idea +.stestr .testrepository .tox .venv @@ -39,4 +40,4 @@ ChangeLog *~ # Vagrant -.vagrant \ No newline at end of file +.vagrant diff --git a/.stestr.conf b/.stestr.conf new file mode 100644 index 000000000..7111fd065 --- /dev/null +++ b/.stestr.conf @@ -0,0 +1,3 @@ +[DEFAULT] +test_path=${TESTS_DIR:-./ironic_inspector/test/unit/} +top_dir=./ diff --git a/test-requirements.txt b/test-requirements.txt index 2de4c9cbc..592f4c5f8 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -8,6 +8,7 @@ hacking<0.13,>=0.12.0 # Apache-2.0 mock>=2.0.0 # BSD sphinx>=1.6.2 # BSD openstackdocstheme>=1.17.0 # Apache-2.0 +os-testr>=1.0.0 # Apache-2.0 reno>=2.5.0 # Apache-2.0 fixtures>=3.0.0 # Apache-2.0/BSD testresources>=2.0.0 # Apache-2.0/BSD diff --git a/tox.ini b/tox.ini index 6d79ffbf7..fd77bfc00 100644 --- a/tox.ini +++ b/tox.ini @@ -8,10 +8,12 @@ deps = -r{toxinidir}/test-requirements.txt -r{toxinidir}/plugin-requirements.txt commands = - coverage run --branch --include "ironic_inspector*" -m unittest discover ironic_inspector.test.unit - coverage report -m --fail-under 90 -setenv = PYTHONDONTWRITEBYTECODE=1 - TZ=UTC + ostestr {posargs} +setenv = + VIRTUAL_ENV={envdir} + PYTHONDONTWRITEBYTECODE=1 + TZ=UTC + TESTS_DIR=./ironic_inspector/test/unit/ passenv = http_proxy HTTP_PROXY https_proxy HTTPS_PROXY no_proxy NO_PROXY [testenv:venv] @@ -22,9 +24,15 @@ envdir = {toxworkdir}/venv commands = sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html [testenv:cover] +setenv = + {[testenv]setenv} + PYTHON=coverage run --branch --omit='*test*' --source ironic_inspector --parallel-mode commands = - coverage run --branch --include "ironic_inspector*" -m unittest discover ironic_inspector.test.unit - coverage report -m + coverage erase + ostestr {posargs} + coverage combine + coverage report -m --omit='*test*' --fail-under 90 + coverage html -d ./cover --omit='*test*' [testenv:pep8] basepython = python2.7