diff --git a/.gitignore b/.gitignore index 94eea934..7da966a3 100644 --- a/.gitignore +++ b/.gitignore @@ -24,8 +24,7 @@ pip-log.txt # Unit test / coverage reports .coverage .tox -nosetests.xml -.testrepository +.stestr/ # Translations *.mo diff --git a/.stestr.conf b/.stestr.conf new file mode 100644 index 00000000..f2027908 --- /dev/null +++ b/.stestr.conf @@ -0,0 +1,3 @@ +[DEFAULT] +test_path=./oslo_cache/tests +top_path=./ diff --git a/.testr.conf b/.testr.conf deleted file mode 100644 index 735255b6..00000000 --- a/.testr.conf +++ /dev/null @@ -1,7 +0,0 @@ -[DEFAULT] -test_command=OS_STDOUT_CAPTURE=${OS_STDOUT_CAPTURE:-1} \ - OS_STDERR_CAPTURE=${OS_STDERR_CAPTURE:-1} \ - OS_TEST_TIMEOUT=${OS_TEST_TIMEOUT:-60} \ - ${PYTHON:-python} -m subunit.run discover -t ./ ./oslo_cache $LISTOPT $IDOPTION -test_id_option=--load-list $IDFILE -test_list_option=--list diff --git a/lower-constraints.txt b/lower-constraints.txt index 26aafe66..b10c20c9 100644 --- a/lower-constraints.txt +++ b/lower-constraints.txt @@ -59,8 +59,8 @@ requestsexceptions==1.4.0 rfc3986==1.1.0 six==1.10.0 smmap2==2.0.3 +stestr==2.0.0 stevedore==1.28.0 -testrepository==0.0.20 testtools==2.3.0 traceback2==1.4.0 unittest2==1.1.0 diff --git a/test-requirements.txt b/test-requirements.txt index 6d4b49b6..0fc85177 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -7,3 +7,4 @@ oslotest>=3.2.0 # Apache-2.0 pifpaf>=0.10.0 # Apache-2.0 # Bandit security code scanner bandit>=1.1.0 # Apache-2.0 +stestr>=2.0.0 # Apache-2.0 diff --git a/tox.ini b/tox.ini index fee3278d..41e21b0d 100644 --- a/tox.ini +++ b/tox.ini @@ -14,17 +14,17 @@ deps = .[dogpile] -r{toxinidir}/test-requirements.txt commands = find . -type f -name "*.pyc" -delete - python setup.py testr --slowest --testr-args='{posargs}' + stestr run --slowest {posargs} [testenv:py27-functional-etcd3gw] commands = find . -type f -name "*.pyc" -delete - {toxinidir}/tools/setup-etcd-env.sh pifpaf -e OSLO_CACHE_TEST run etcd -- python setup.py testr --slowest --testr-args='functional.*' + {toxinidir}/tools/setup-etcd-env.sh pifpaf -e OSLO_CACHE_TEST run etcd -- stestr run --slowest functional.* [testenv:py35-functional-etcd3gw] commands = find . -type f -name "*.pyc" -delete - {toxinidir}/tools/setup-etcd-env.sh pifpaf -e OSLO_CACHE_TEST run etcd -- python setup.py testr --slowest --testr-args='functional.*' + {toxinidir}/tools/setup-etcd-env.sh pifpaf -e OSLO_CACHE_TEST run etcd -- stestr run --slowest functional.* [testenv:pep8] basepython = python3 @@ -49,7 +49,13 @@ commands = [testenv:cover] basepython = python3 -commands = python setup.py testr --coverage --testr-args='{posargs}' +setenv = + PYTHON=coverage run --source $project --parallel-mode +commands = + stestr run '{posargs}' + coverage combine + coverage html -d cover + coverage xml -o cover/coverage.xml [flake8] show-source = True