diff options
author | Vu Cong Tuan <tuanvc@vn.fujitsu.com> | 2018-07-12 14:27:07 +0700 |
---|---|---|
committer | Vu Cong Tuan <tuanvc@vn.fujitsu.com> | 2018-07-13 10:18:54 +0700 |
commit | 944fe4b6c11abc06386eec670f10784277455b49 (patch) | |
tree | 6c252e8cdbb4cd34a81dc4cc59d03ae3121f4383 | |
parent | dff11337f55b7a9a28d7c30658df51b7b0b443eb (diff) | |
download | oslo-db-944fe4b6c11abc06386eec670f10784277455b49.tar.gz |
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: Ifd51e726de277d33ff61db47110bf8b5563fcda7
-rw-r--r-- | .gitignore | 2 | ||||
-rw-r--r-- | .stestr.conf | 4 | ||||
-rw-r--r-- | .testr.conf | 7 | ||||
-rw-r--r-- | lower-constraints.txt | 2 | ||||
-rw-r--r-- | test-requirements.txt | 2 | ||||
-rwxr-xr-x | tools/pretty_tox.sh | 16 | ||||
-rwxr-xr-x | tools/run-pifpaf-tests.sh | 4 | ||||
-rw-r--r-- | tox.ini | 16 |
8 files changed, 20 insertions, 33 deletions
@@ -14,7 +14,7 @@ AUTHORS .update-venv/ ChangeLog *.egg -.testrepository/ +.stestr/ .project .pydevproject oslo.db.egg-info/ diff --git a/.stestr.conf b/.stestr.conf new file mode 100644 index 0000000..7022eae --- /dev/null +++ b/.stestr.conf @@ -0,0 +1,4 @@ +[DEFAULT] +test_path=${OS_TEST_PATH:-oslo_db/tests} +top_dir=./ + diff --git a/.testr.conf b/.testr.conf deleted file mode 100644 index c9be815..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 ./ ./oslo_db/tests $LISTOPT $IDOPTION -test_id_option=--load-list $IDFILE -test_list_option=--list diff --git a/lower-constraints.txt b/lower-constraints.txt index 50fd752..a182845 100644 --- a/lower-constraints.txt +++ b/lower-constraints.txt @@ -58,10 +58,10 @@ smmap==0.9.0 SQLAlchemy==1.0.10 sqlalchemy-migrate==0.11.0 sqlparse==0.2.2 -stestr==1.0.0 stevedore==1.20.0 Tempita==0.5.2 testrepository==0.0.18 +stestr==2.0.0 testresources==2.0.0 testscenarios==0.4 testtools==2.2.0 diff --git a/test-requirements.txt b/test-requirements.txt index 3b06eec..0f5306d 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -9,7 +9,7 @@ mock>=2.0.0 # BSD python-subunit>=1.0.0 # Apache-2.0/BSD oslotest>=3.2.0 # Apache-2.0 oslo.context>=2.19.2 # Apache-2.0 -testrepository>=0.0.18 # Apache-2.0/BSD +stestr>=2.0.0 # Apache-2.0 testtools>=2.2.0 # MIT os-testr>=1.0.0 # Apache-2.0 bandit>=1.1.0 # Apache-2.0 diff --git a/tools/pretty_tox.sh b/tools/pretty_tox.sh deleted file mode 100755 index 9699a6f..0000000 --- a/tools/pretty_tox.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/usr/bin/env bash - -# return nonzero exit status of rightmost command, so that we -# get nonzero exit on test failure without halting subunit-trace -set -o pipefail - - -TESTRARGS=$1 - -python setup.py testr --testr-args="--subunit $TESTRARGS" | subunit-trace -f -retval=$? -# NOTE(mtreinish) The pipe above would eat the slowest display from pbr's testr -# wrapper so just manually print the slowest tests -echo -e "\nSlowest Tests:\n" -testr slowest -exit $retval diff --git a/tools/run-pifpaf-tests.sh b/tools/run-pifpaf-tests.sh index 687b6bb..ee21c69 100755 --- a/tools/run-pifpaf-tests.sh +++ b/tools/run-pifpaf-tests.sh @@ -3,5 +3,5 @@ set -e # Replace mysql:// by mysql+pymysql:// and add sqlite export OS_TEST_DBAPI_ADMIN_CONNECTION="${OS_TEST_DBAPI_ADMIN_CONNECTION/#mysql:/mysql+pymysql:};sqlite://" echo $OS_TEST_DBAPI_ADMIN_CONNECTION -tools/pretty_tox.sh $* -TEST_EVENTLET=1 tools/pretty_tox.sh $* +stestr run $* +TEST_EVENTLET=1 stestr run $* @@ -8,7 +8,7 @@ whitelist_externals = bash env setenv = VIRTUAL_ENV={envdir} - BASECOMMAND=bash tools/pretty_tox.sh + BASECOMMAND=stestr run BRANCH_NAME=master CLIENT_NAME=oslo.db @@ -20,15 +20,15 @@ deps = -r{toxinidir}/test-requirements.txt -r{toxinidir}/requirements.txt commands = - {env:PIFPAF_MYSQL:} {env:PIFPAF_POSTGRESQL:} {env:BASECOMMAND:} '{posargs}' + {env:PIFPAF_MYSQL:} {env:PIFPAF_POSTGRESQL:} {env:BASECOMMAND:} {posargs} passenv = OS_TEST_DBAPI_ADMIN_CONNECTION [testenv:py27] basepython = python2.7 commands = - env TEST_EVENTLET=0 bash tools/pretty_tox.sh '{posargs}' - env TEST_EVENTLET=1 bash tools/pretty_tox.sh '{posargs}' + env TEST_EVENTLET=0 stestr run {posargs} + env TEST_EVENTLET=1 stestr run {posargs} [testenv:pep8] basepython = python3 @@ -43,7 +43,13 @@ commands = {posargs} [testenv:cover] basepython = python3 -commands = python setup.py test --coverage --coverage-package-name=oslo_db --testr-args='{posargs}' +setenv = + PYTHON=coverage run --source oslo_db --parallel-mode +commands = + stestr run '{posargs}' + coverage combine + coverage html -d cover + coverage xml -o cover/coverage.xml [testenv:docs] basepython = python3 |