From 800e1be48ea095cda219eb6af52bf5b9b151122e Mon Sep 17 00:00:00 2001 From: Vu Cong Tuan Date: Wed, 11 Jul 2018 08:50:50 +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: I44170fcc60ad6e12d7badec354a96873e5cc91ea --- .gitignore | 2 +- .stestr.conf | 4 ++++ .testr.conf | 8 -------- lower-constraints.txt | 2 +- test-requirements.txt | 2 +- tox.ini | 9 +++++++-- 6 files changed, 14 insertions(+), 13 deletions(-) create mode 100644 .stestr.conf delete mode 100644 .testr.conf diff --git a/.gitignore b/.gitignore index fbfa3551..c8579b32 100644 --- a/.gitignore +++ b/.gitignore @@ -21,7 +21,7 @@ develop-eggs .installed.cfg # Other -.testrepository +.stestr/ .tox .*.swp .coverage diff --git a/.stestr.conf b/.stestr.conf new file mode 100644 index 00000000..5e179dd0 --- /dev/null +++ b/.stestr.conf @@ -0,0 +1,4 @@ +[DEFAULT] +test_path=./hacking/tests +top_dir=./ + diff --git a/.testr.conf b/.testr.conf deleted file mode 100644 index 748029b4..00000000 --- a/.testr.conf +++ /dev/null @@ -1,8 +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 ./ . $LISTOPT $IDOPTION - -test_id_option=--load-list $IDFILE -test_list_option=--list diff --git a/lower-constraints.txt b/lower-constraints.txt index 3cb1f662..db18d950 100644 --- a/lower-constraints.txt +++ b/lower-constraints.txt @@ -29,7 +29,7 @@ six==1.10.0 snowballstemmer==1.2.1 Sphinx==1.6.5 sphinxcontrib-websupport==1.0.1 -testrepository==0.0.18 +stestr==2.0.0 testscenarios==0.4 testtools==2.2.0 traceback2==1.4.0 diff --git a/test-requirements.txt b/test-requirements.txt index 3104ceb1..92470b46 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -7,7 +7,7 @@ mock>=2.0.0 # BSD python-subunit>=1.0.0 # Apache-2.0/BSD sphinx!=1.6.6,!=1.6.7,>=1.6.2 # BSD openstackdocstheme>=1.18.1 # Apache-2.0 -testrepository>=0.0.18 # Apache-2.0/BSD +stestr>=2.0.0 # Apache-2.0 testscenarios>=0.4 # Apache-2.0/BSD testtools>=2.2.0 # MIT diff --git a/tox.ini b/tox.ini index dd203e23..9e34d41b 100644 --- a/tox.ini +++ b/tox.ini @@ -11,7 +11,7 @@ deps = -r{toxinidir}/requirements.txt -r{toxinidir}/test-requirements.txt commands = - python setup.py testr --slowest --testr-args='{posargs}' + stestr run --slowest {posargs} [tox:jenkins] sitepackages = True @@ -28,8 +28,13 @@ commands = [testenv:cover] basepython = python3 +setenv = + PYTHON=coverage run --source $project --parallel-mode commands = - python setup.py testr --coverage + stestr run '{posargs}' + coverage combine + coverage html -d cover + coverage xml -o cover/coverage.xml [testenv:venv] basepython = python3