From 14bfbbfc095c8619ad84bac2ce3dc8930e751614 Mon Sep 17 00:00:00 2001 From: Masayuki Igawa Date: Mon, 11 Sep 2017 13:58:53 -0600 Subject: [PATCH] Switch to use stestr instead of ostestr This commit switches to use stestr[1] instead of ostestr. We don't need to use ostestr layer because we can use stestr directory. [1] https://github.com/mtreinish/stestr Change-Id: I566dca2f3052520a09558bf315b433984c221034 --- .gitignore | 2 +- .stestr.conf | 2 ++ test-requirements.txt | 2 +- tox.ini | 11 +++++++++-- 4 files changed, 13 insertions(+), 4 deletions(-) create mode 100644 .stestr.conf diff --git a/.gitignore b/.gitignore index 825af814..8dc2f5b7 100644 --- a/.gitignore +++ b/.gitignore @@ -35,7 +35,7 @@ pip-log.txt !.coveragerc .tox nosetests.xml -.testrepository +.stestr .venv # Translations diff --git a/.stestr.conf b/.stestr.conf new file mode 100644 index 00000000..7a36f1c5 --- /dev/null +++ b/.stestr.conf @@ -0,0 +1,2 @@ +[DEFAULT] +test_path=./openstack_health/tests diff --git a/test-requirements.txt b/test-requirements.txt index 9cea36bf..cda2e018 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -5,7 +5,7 @@ hacking<0.11,>=0.10.0 coverage!=4.4,>=4.0 # Apache-2.0 docutils>=0.11 # OSI-Approved Open Source, Public Domain -os-testr>=0.8.0 # Apache-2.0 +stestr>=1.0.0 # Apache-2.0 mock>=2.0 # BSD fixtures>=3.0.0 # Apache-2.0/BSD sphinx>=1.6.2 # BSD diff --git a/tox.ini b/tox.ini index d62278a7..bfeabf24 100644 --- a/tox.ini +++ b/tox.ini @@ -12,7 +12,7 @@ deps = -r{toxinidir}/requirements.txt -r{toxinidir}/test-requirements.txt commands = find . -type f -name "*.pyc" -delete - ostestr {posargs} + stestr run {posargs} [testenv:venv] commands = {posargs} @@ -26,7 +26,14 @@ commands = flake8 {toxinidir}/openstack_health {posargs} [testenv:cover] -commands = python setup.py test --coverage --coverage-package-name='openstack_health' --testr-args={posargs} +setenv = + {[testenv]setenv} + PYTHON = coverage run --source openstack_health --parallel-mode +commands = + stestr run {posargs} + coverage combine + coverage html -d cover + coverage xml -o cover/coverage.xml [flake8] # E125 is a won't fix until https://github.com/jcrocholl/pep8/issues/126 is resolved. For further detail see https://review.openstack.org/#/c/36788/