From d3165af5b939b98e8f7c42a9613d556fa3f58a2c Mon Sep 17 00:00:00 2001 From: Vu Cong Tuan Date: Mon, 9 Jul 2018 13:30:30 +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: Ie84d18b0bcc2a33587bd72204c0eb3dad687be7e --- .gitignore | 3 +-- .stestr.conf | 3 +++ .testr.conf | 7 ------- lower-constraints.txt | 3 ++- test-requirements.txt | 4 ++-- tox.ini | 12 +++++++++--- 6 files changed, 17 insertions(+), 15 deletions(-) create mode 100644 .stestr.conf delete mode 100644 .testr.conf diff --git a/.gitignore b/.gitignore index 1c619b7..bf7e19b 100644 --- a/.gitignore +++ b/.gitignore @@ -24,8 +24,7 @@ pip-log.txt # Unit test / coverage reports .coverage .tox -nosetests.xml -.testrepository +.stestr/ .venv # Translations diff --git a/.stestr.conf b/.stestr.conf new file mode 100644 index 0000000..3e1f12a --- /dev/null +++ b/.stestr.conf @@ -0,0 +1,3 @@ +[DEFAULT] +test_path=./debtcollector/tests +top_dir=./ diff --git a/.testr.conf b/.testr.conf deleted file mode 100644 index fb62267..0000000 --- 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 ./ . $LISTOPT $IDOPTION -test_id_option=--load-list $IDFILE -test_list_option=--list \ No newline at end of file diff --git a/lower-constraints.txt b/lower-constraints.txt index b9c103e..eb6de18 100644 --- a/lower-constraints.txt +++ b/lower-constraints.txt @@ -8,6 +8,7 @@ dulwich==0.15.0 extras==1.0.0 fixtures==3.0.0 flake8==2.2.4 +funcsigs==1.0.0 hacking==0.10.3 imagesize==0.7.1 Jinja2==2.10 @@ -31,7 +32,7 @@ snowballstemmer==1.2.1 Sphinx==1.6.5 sphinxcontrib-websupport==1.0.1 stevedore==1.20.0 -testrepository==0.0.18 +stestr==2.0.0 testtools==2.2.0 traceback2==1.4.0 unittest2==1.1.0 diff --git a/test-requirements.txt b/test-requirements.txt index f39b68a..4626f54 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -6,9 +6,9 @@ hacking<0.11,>=0.10.0 coverage!=4.4,>=4.0 # Apache-2.0 python-subunit>=1.0.0 # Apache-2.0/BSD -sphinx!=1.6.6,!=1.6.7,>=1.6.2 # BSD +sphinx!=1.6.6,!=1.6.7,>=1.6.5 # BSD openstackdocstheme>=1.18.1 # Apache-2.0 -testrepository>=0.0.18 # Apache-2.0/BSD +stestr>=2.0.0 # Apache-2.0 testtools>=2.2.0 # MIT fixtures>=3.0.0 # Apache-2.0/BSD doc8>=0.6.0 # Apache-2.0 diff --git a/tox.ini b/tox.ini index 91786a4..a1db11d 100644 --- a/tox.ini +++ b/tox.ini @@ -12,7 +12,7 @@ deps = -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt} -r{toxinidir}/test-requirements.txt -r{toxinidir}/requirements.txt -commands = python setup.py testr --slowest --testr-args='{posargs}' +commands = stestr run --slowest {posargs} [testenv:debug] basepython = python3 @@ -32,7 +32,13 @@ commands = {posargs} [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 [testenv:docs] basepython = python3 @@ -41,7 +47,7 @@ commands = python setup.py build_sphinx [testenv:py27] basepython = python2.7 commands = - python setup.py testr --slowest --testr-args='{posargs}' + stestr run --slowest {posargs} sphinx-build -b doctest doc/source doc/build doc8 --ignore-path "doc/source/history.rst" doc/source