From 47d88430ce67e26a7c117c4949e58c974e552e7f Mon Sep 17 00:00:00 2001 From: Vu Cong Tuan Date: Tue, 10 Jul 2018 17:44:27 +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: I63079f352ff36dda4f3f64a8681431a319791f0e --- .gitignore | 2 +- .stestr.conf | 4 ++++ .testr.conf | 7 ------- lower-constraints.txt | 2 +- requirements.txt | 1 + test-requirements.txt | 2 +- tox.ini | 9 +++++++-- 7 files changed, 15 insertions(+), 12 deletions(-) create mode 100644 .stestr.conf delete mode 100644 .testr.conf diff --git a/.gitignore b/.gitignore index c71843a197..679ab8f45b 100644 --- a/.gitignore +++ b/.gitignore @@ -24,7 +24,7 @@ __pycache__/ *$py.class # the files generated from tox command. -.testrepository/ +.stestr/ AUTHORS ChangeLog doc/build diff --git a/.stestr.conf b/.stestr.conf new file mode 100644 index 0000000000..dcdf16e8d7 --- /dev/null +++ b/.stestr.conf @@ -0,0 +1,4 @@ +[DEFAULT] +test_path=./tests +top_dir=./ + diff --git a/.testr.conf b/.testr.conf deleted file mode 100644 index 9c322599c3..0000000000 --- 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:-7200} \ - ${PYTHON:-python} -m subunit.run discover ${OS_TEST_PATH:-.} $LISTOPT $IDOPTION -test_id_option=--load-list $IDFILE -test_list_option=--list diff --git a/lower-constraints.txt b/lower-constraints.txt index 271453829b..9b3e74cd14 100644 --- a/lower-constraints.txt +++ b/lower-constraints.txt @@ -93,7 +93,7 @@ snowballstemmer==1.2.1 Sphinx==1.6.2 sphinxcontrib-websupport==1.0.1 stevedore==1.28.0 -testrepository==0.0.18 +stestr==2.0.0 testscenarios==0.4 testtools==2.2.0 traceback2==1.4.0 diff --git a/requirements.txt b/requirements.txt index d7f806744c..9866dffb0f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -11,3 +11,4 @@ setuptools!=24.0.0,!=34.0.0,!=34.0.1,!=34.0.2,!=34.0.3,!=34.1.0,!=34.1.1,!=34.2. PyYAML>=3.12 # MIT netaddr>=0.7.18 # BSD cryptography>=2.1 # BSD/Apache-2.0 +stestr>=2.0.0 # Apache-2.0 diff --git a/test-requirements.txt b/test-requirements.txt index 9782665059..097f938977 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -16,6 +16,6 @@ python-ceilometerclient>=2.5.0 # Apache-2.0 python-neutronclient>=6.7.0 # Apache-2.0 python-openstackclient>=3.12.0 # Apache-2.0 pytz>=2013.6 # MIT -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 731a5f4c16..b6e886ac18 100644 --- a/tox.ini +++ b/tox.ini @@ -17,7 +17,7 @@ passenv = http_proxy HTTP_PROXY https_proxy HTTPS_PROXY no_proxy NO_PROXY commands = find . -type f -name "*.py[c|o]" -delete find . -type d -name "__pycache__" -delete - python setup.py test --slowest --testr-args='{posargs}' + stestr run --slowest {posargs} [testenv:debug] commands = oslo_debug_helper -t tests {posargs} @@ -28,7 +28,12 @@ setenv = VIRTUAL_ENV={envdir} NOSE_COVER_BRANCHES=1 NOSE_COVER_HTML=1 NOSE_COVER_HTML_DIR={toxinidir}/cover -commands = python setup.py testr --coverage --testr-args='{posargs}' + PYTHON=coverage run --source kolla_ansible --parallel-mode +commands = + stestr run '{posargs}' + coverage combine + coverage html -d cover + coverage xml -o cover/coverage.xml [testenv:pep8] # sphinx needs to be installed to make doc8 work properly