diff --git a/.gitignore b/.gitignore index 5395e5c5..c3dad675 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ .coverage .testrepository +.stestr subunit.log .venv *,cover diff --git a/.stestr.conf b/.stestr.conf new file mode 100644 index 00000000..da812950 --- /dev/null +++ b/.stestr.conf @@ -0,0 +1,3 @@ +[DEFAULT] +test_path=./keystoneauth1/tests/unit +top_dir=./ diff --git a/.testr.conf b/.testr.conf deleted file mode 100644 index 6595c1a6..00000000 --- a/.testr.conf +++ /dev/null @@ -1,4 +0,0 @@ -[DEFAULT] -test_command=${PYTHON:-python} -m subunit.run discover -t ./ ${OS_TEST_PATH:-./keystoneauth1/tests/unit} $LISTOPT $IDOPTION -test_id_option=--load-list $IDFILE -test_list_option=--list diff --git a/HACKING.rst b/HACKING.rst index e56cfffc..033dda03 100644 --- a/HACKING.rst +++ b/HACKING.rst @@ -15,10 +15,10 @@ exceptions to an instance or subclass of ClientException. Testing ======= -keystoneauth uses testtools and testr for its unittest suite -and its test runner. Basic workflow around our use of tox and testr can +keystoneauth uses testtools and stestr for its unittest suite +and its test runner. Basic workflow around our use of tox and stestr can be found at https://wiki.openstack.org/testr. If you'd like to learn more in depth: - https://testtools.readthedocs.org/ - https://testrepository.readthedocs.org/ + https://testtools.readthedocs.io/en/latest/ + https://stestr.readthedocs.io/en/latest/ diff --git a/test-requirements.txt b/test-requirements.txt index 2a34af57..67e98167 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -18,7 +18,7 @@ betamax>=0.7.0 # Apache-2.0 reno>=2.5.0 # Apache-2.0 requests-mock>=1.1.0 # Apache-2.0 sphinx>=1.6.2 # BSD -testrepository>=0.0.18 # Apache-2.0/BSD +stestr>=1.0.0 # Apache-2.0 testresources>=0.2.4 # Apache-2.0/BSD testtools>=1.4.0 # MIT PyYAML>=3.10 # MIT diff --git a/tox.ini b/tox.ini index b21e55e8..ce8619cc 100644 --- a/tox.ini +++ b/tox.ini @@ -36,7 +36,14 @@ commands = bandit -r keystoneauth1 -x tests -s B110,B410 commands = {posargs} [testenv:cover] -commands = python setup.py testr --coverage --testr-args='{posargs}' +setenv = + {[testenv]setenv} + PYTHON=coverage run --source keystoneauth1 --parallel-mode +commands = + stestr run {posargs} + coverage combine + coverage html -d cover + coverage xml -o cover/coverage.xml [testenv:debug] commands = oslo_debug_helper -t keystoneauth1/tests {posargs}