From a3fd90b776c3cd1fb51bb71829e33ab6f86e8954 Mon Sep 17 00:00:00 2001 From: Vu Cong Tuan Date: Tue, 10 Jul 2018 15:01:15 +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: Icb3886271885bfee19981a6acdda3163f3cd72f8 --- .gitignore | 3 +-- .stestr.conf | 4 ++++ .testr.conf | 5 ----- test-requirements.txt | 2 +- tox.ini | 13 +++++++++---- 5 files changed, 15 insertions(+), 12 deletions(-) create mode 100644 .stestr.conf delete mode 100644 .testr.conf diff --git a/.gitignore b/.gitignore index 5a1a6257..71ea2839 100644 --- a/.gitignore +++ b/.gitignore @@ -34,10 +34,9 @@ pip-delete-this-directory.txt # Unit test / coverage reports htmlcov/ .tox/ -.testrepository +.stestr/ .coverage .cache -nosetests.xml coverage.xml cover diff --git a/.stestr.conf b/.stestr.conf new file mode 100644 index 00000000..7dee135b --- /dev/null +++ b/.stestr.conf @@ -0,0 +1,4 @@ +[DEFAULT] +test_path=./cloudkitty/tests +top_dir=./ +group_regex=gabbi\.(suitemaker|driver)\.(test_[^_]+_[^_]+) diff --git a/.testr.conf b/.testr.conf deleted file mode 100644 index 903f0ea9..00000000 --- a/.testr.conf +++ /dev/null @@ -1,5 +0,0 @@ -[DEFAULT] -test_command=${PYTHON:-python} -m subunit.run discover -t ./ ./cloudkitty/tests $LISTOPT $IDOPTION -test_id_option=--load-list $IDFILE -test_list_option=--list -group_regex=gabbi\.(suitemaker|driver)\.(test_[^_]+_[^_]+) diff --git a/test-requirements.txt b/test-requirements.txt index 23991205..dbb71a9b 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -10,7 +10,7 @@ kombu<4.0.0 # BSD ddt>=1.0.1 # MIT gabbi>=1.26.1 # Apache-2.0 testscenarios>=0.4 # Apache-2.0/BSD -testrepository>=0.0.18 # Apache-2.0/BSD +stestr>=2.0.0 # Apache-2.0 mock>=1.2 # BSD sphinx>=1.6.2 # BSD openstackdocstheme>=1.11.0 # Apache-2.0 diff --git a/tox.ini b/tox.ini index 82575f50..f003797a 100644 --- a/tox.ini +++ b/tox.ini @@ -15,7 +15,7 @@ deps = -r{toxinidir}/requirements.txt commands = /usr/bin/find . -type f -name "*.py[co]" -delete rm -f .testrepository/times.dbm - python setup.py testr --testr-args='{posargs}' + stestr run {posargs} [testenv:debug] basepython = python3 @@ -28,10 +28,15 @@ commands = [testenv:cover] basepython = python3 -setenv = VIRTUAL_ENV={envdir} +setenv = + VIRTUAL_ENV={envdir} + PYTHON=coverage run --source $project --parallel-mode commands = - python setup.py testr --coverage --testr-args='{posargs}' - coverage report + stestr run '{posargs}' + coverage combine + coverage html -d cover + coverage xml -o cover/coverage.xml + coverage report [testenv:genconfig] basepython = python3