summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVu Cong Tuan <tuanvc@vn.fujitsu.com>2018-07-12 15:23:08 +0700
committerVu Cong Tuan <tuanvc@vn.fujitsu.com>2018-07-16 15:43:48 +0700
commit32a3244bb4879f5c0ea430de6fac284b2a987441 (patch)
tree23e6ac39d8f500cf3b903a88a4a10ec59634cc96
parent2e6ef0c45a6ada10440eb0ce87df74bf7070c1e4 (diff)
downloadpython-novaclient-32a3244bb4879f5c0ea430de6fac284b2a987441.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: I55060b1d99b9a00b20c98fbb429d072568265695
-rw-r--r--.gitignore2
-rw-r--r--.stestr.conf3
-rw-r--r--.testr.conf7
-rw-r--r--lower-constraints.txt4
-rw-r--r--test-requirements.txt3
-rwxr-xr-xtools/pretty_tox.sh16
-rw-r--r--tox.ini22
7 files changed, 16 insertions, 41 deletions
diff --git a/.gitignore b/.gitignore
index 82ede6ad..611c10e3 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,6 +1,6 @@
.coverage
.venv
-.testrepository
+.stestr/
subunit.log
.tox
*,cover
diff --git a/.stestr.conf b/.stestr.conf
new file mode 100644
index 00000000..ac945e83
--- /dev/null
+++ b/.stestr.conf
@@ -0,0 +1,3 @@
+[DEFAULT]
+test_path=${OS_TEST_PATH:-./novaclient/tests/unit}
+top_dir=./
diff --git a/.testr.conf b/.testr.conf
deleted file mode 100644
index c8fae426..00000000
--- 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:-300} \
- ${PYTHON:-python} -m subunit.run discover -t ./ ${OS_TEST_PATH:-./novaclient/tests/unit} $LISTOPT $IDOPTION
-test_id_option=--load-list $IDFILE
-test_list_option=--list
diff --git a/lower-constraints.txt b/lower-constraints.txt
index c1cf2fc7..4f156569 100644
--- a/lower-constraints.txt
+++ b/lower-constraints.txt
@@ -48,7 +48,6 @@ netifaces==0.10.4
openstacksdk==0.11.2
os-client-config==1.28.0
os-service-types==1.2.0
-os-testr==1.0.0
osc-lib==1.8.0
oslo.concurrency==3.25.0
oslo.config==5.2.0
@@ -96,11 +95,10 @@ simplejson==3.5.1
six==1.10.0
smmap==0.9.0
statsd==3.2.1
-stestr==1.0.0
stevedore==1.20.0
tempest==17.1.0
tenacity==3.2.1
-testrepository==0.0.18
+stestr==2.0.0
testscenarios==0.4
testtools==2.2.0
traceback2==1.4.0
diff --git a/test-requirements.txt b/test-requirements.txt
index 271300b2..3c35fec9 100644
--- a/test-requirements.txt
+++ b/test-requirements.txt
@@ -15,9 +15,8 @@ python-glanceclient>=2.8.0 # Apache-2.0
python-neutronclient>=6.7.0 # Apache-2.0
requests-mock>=1.2.0 # Apache-2.0
os-client-config>=1.28.0 # Apache-2.0
-os-testr>=1.0.0 # Apache-2.0
osprofiler>=1.4.0 # Apache-2.0
-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
tempest>=17.1.0 # Apache-2.0
diff --git a/tools/pretty_tox.sh b/tools/pretty_tox.sh
deleted file mode 100755
index 799ac184..00000000
--- a/tools/pretty_tox.sh
+++ /dev/null
@@ -1,16 +0,0 @@
-#!/usr/bin/env bash
-
-set -o pipefail
-
-TESTRARGS=$1
-
-# --until-failure is not compatible with --subunit see:
-#
-# https://bugs.launchpad.net/testrepository/+bug/1411804
-#
-# this work around exists until that is addressed
-if [[ "$TESTARGS" =~ "until-failure" ]]; then
- python setup.py testr --slowest --testr-args="$TESTRARGS"
-else
- python setup.py testr --slowest --testr-args="--subunit $TESTRARGS" | subunit-trace -f
-fi
diff --git a/tox.ini b/tox.ini
index 852e234f..b3666b18 100644
--- a/tox.ini
+++ b/tox.ini
@@ -9,7 +9,6 @@ usedevelop = True
# tox is silly... these need to be separated by a newline....
whitelist_externals =
find
- bash
rm
passenv = ZUUL_CACHE_DIR
REQUIREMENTS_PIP_LOCATION
@@ -20,9 +19,7 @@ deps =
-r{toxinidir}/requirements.txt
commands =
find . -type f -name "*.pyc" -delete
- bash tools/pretty_tox.sh '{posargs}'
- # there is also secret magic in pretty_tox.sh which lets you run in a fail only
- # mode. To do this define the TRACE_FAILONLY environmental variable.
+ stestr run {posargs}
[testenv:pep8]
basepython = python3
@@ -63,26 +60,27 @@ commands =
[testenv:functional]
basepython = python2.7
passenv = OS_NOVACLIENT_TEST_NETWORK
-setenv =
- OS_TEST_PATH = ./novaclient/tests/functional
commands =
- bash tools/pretty_tox.sh '--concurrency=1 {posargs}'
+ stestr --test-path=./novaclient/tests/functional run --concurrency=1 {posargs}
python novaclient/tests/functional/hooks/check_resources.py
[testenv:functional-py35]
basepython = python3.5
passenv = OS_NOVACLIENT_TEST_NETWORK
-setenv =
- OS_TEST_PATH = ./novaclient/tests/functional
commands =
- bash tools/pretty_tox.sh '--concurrency=1 {posargs}'
+ stestr --test-path=./novaclient/tests/functional run --concurrency=1 {posargs}
python novaclient/tests/functional/hooks/check_resources.py
[testenv:cover]
basepython = python3
+setenv =
+ PYTHON=coverage run --source novaclient --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
[flake8]
# Following checks should be enabled in the future.