From 03dc05dec34963efb5ae5cbc9cc420b6f21f152a Mon Sep 17 00:00:00 2001 From: Vu Cong Tuan Date: Tue, 3 Jul 2018 09:39:49 +0700 Subject: [PATCH] Switch to stestr According to Openstack summit session [1], stestr is maintained project to which all Openstack projects should migrate. Let's switch to stestr as other projects have already moved to it. [1] https://etherpad.openstack.org/p/YVR-python-pti Change-Id: I829d57082b4fb981dfab6ed0f976bb30f28b7901 --- .gitignore | 3 +-- .stestr.conf | 3 +++ .testr.conf | 7 ------- lower-constraints.txt | 2 +- test-requirements.txt | 1 + tox.ini | 14 ++++++++++---- 6 files changed, 16 insertions(+), 14 deletions(-) create mode 100644 .stestr.conf delete mode 100644 .testr.conf 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