From db99a4ab7958e4446431a7f5cf873a80f60303de Mon Sep 17 00:00:00 2001 From: Vu Cong Tuan Date: Wed, 11 Jul 2018 10:48:18 +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: I0ec7bc7926e57b243e38b2c696815e648d0b3f61 --- .gitignore | 2 +- .stestr.conf | 4 ++++ .testr.conf | 9 --------- lower-constraints.txt | 2 +- test-requirements.txt | 2 +- tox.ini | 38 +++++++++++++------------------------- 6 files changed, 20 insertions(+), 37 deletions(-) create mode 100644 .stestr.conf delete mode 100644 .testr.conf diff --git a/.gitignore b/.gitignore index 19dc466b..ca396c6e 100644 --- a/.gitignore +++ b/.gitignore @@ -15,7 +15,7 @@ coverage.xml *.py[co] .DS_Store *.log -.testrepository +.stestr/ subunit.log .eggs AUTHORS diff --git a/.stestr.conf b/.stestr.conf new file mode 100644 index 00000000..36db8ded --- /dev/null +++ b/.stestr.conf @@ -0,0 +1,4 @@ +[DEFAULT] +test_path=${OS_TEST_PATH:-./freezer/tests/unit} +top_dir=./ +group_regex=([^\.]+\.)+ diff --git a/.testr.conf b/.testr.conf deleted file mode 100644 index de8ad7f3..00000000 --- a/.testr.conf +++ /dev/null @@ -1,9 +0,0 @@ -[DEFAULT] -test_command=OS_STDOUT_CAPTURE=${OS_STDOUT_CAPTURE:-1} \ - OS_STDERR_CAPTURE=${OS_STDERR_CAPTURE:-1} \ - OS_LOG_CAPTURE=${OS_LOG_CAPTURE:-1} \ - ${PYTHON:-python} -m subunit.run discover -s ${OS_TEST_PATH:-./freezer/tests/unit} -t . $LISTOPT $IDOPTION - -test_id_option=--load-list $IDFILE -test_list_option=--list -group_regex=([^\.]+\.)+ diff --git a/lower-constraints.txt b/lower-constraints.txt index 699c2f60..214da7b4 100644 --- a/lower-constraints.txt +++ b/lower-constraints.txt @@ -113,7 +113,7 @@ sphinxcontrib-websupport==1.0.1 stestr==2.0.0 stevedore==1.28.0 tempest==17.1.0 -testrepository==0.0.18 +stestr==2.0.0 testtools==2.2.0 traceback2==1.4.0 tzlocal==1.5.1 diff --git a/test-requirements.txt b/test-requirements.txt index 5d2b7acb..7ffb6d53 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -9,7 +9,7 @@ mock>=2.0.0 # BSD pylint==1.4.5 # GPLv2 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 testtools>=2.2.0 # MIT reno>=2.5.0 # Apache-2.0 astroid<1.4.0 # LGPLv2.1 # breaks pylint 1.4.4 diff --git a/tox.ini b/tox.ini index 33883c2b..e06b8d83 100644 --- a/tox.ini +++ b/tox.ini @@ -22,7 +22,19 @@ passenv = http_proxy HTTP_PROXY https_proxy HTTPS_PROXY no_proxy NO_PROXY install_command = pip install -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt} {opts} {packages} -setenv = VIRTUAL_ENV={envdir} +setenv = + VIRTUAL_ENV={envdir} + OS_TEST_PATH = ./freezer/tests/unit + PYTHON=coverage run --source freezer --parallel-mode +commands = + find . -type f -name "*.pyc" -delete + stestr run '{posargs}' + coverage combine + coverage html -d cover + coverage xml -o cover/coverage.xml + coverage report -m + rm -f .coverage + rm -rf .testrepository whitelist_externals = find @@ -37,36 +49,12 @@ commands = {posargs} [testenv:py27] basepython = python2.7 -setenv = - OS_TEST_PATH = ./freezer/tests/unit -commands = - find . -type f -name "*.pyc" -delete - python setup.py testr --coverage --testr-args="{posargs}" - coverage report -m - rm -f .coverage - rm -rf .testrepository [testenv:py35] basepython = python3.5 -setenv = - OS_TEST_PATH = ./freezer/tests/unit -commands = - find . -type f -name "*.pyc" -delete - python setup.py testr --coverage --testr-args="{posargs}" - coverage report -m - rm -f .coverage - rm -rf .testrepository [testenv:py36] basepython = python3.6 -setenv = - OS_TEST_PATH = ./freezer/tests/unit -commands = - find . -type f -name "*.pyc" -delete - python setup.py testr --coverage --testr-args="{posargs}" - coverage report -m - rm -f .coverage - rm -rf .testrepository [testenv:docs] whitelist_externals = rm