summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHa Manh Dong <donghm@vn.fujitsu.com>2018-07-18 20:14:05 -0400
committerZane Bitter <zbitter@redhat.com>2018-07-19 15:30:51 -0400
commit97aec93e2b2c0d2dc6a0d7ddddba962dee007cec (patch)
tree9a62599b809a6e05b4f08a9c680d5b85635b65b8
parentd6f8cda665221535c537abda3c80223cdef8b536 (diff)
downloadheat-cfntools-97aec93e2b2c0d2dc6a0d7ddddba962dee007cec.tar.gz
Switch to use stestr for unit test
According to Openstack summit session [1], stestr is maintained project to which all Openstack projects should migrate. So we should switch to stestr. [1] https://etherpad.openstack.org/p/YVR-python-pti Change-Id: I14ae3879465e622f36fd7bba3f04cb6e0cb7500e
-rw-r--r--.gitignore2
-rw-r--r--.stestr.conf3
-rw-r--r--.testr.conf4
-rw-r--r--lower-constraints.txt2
-rw-r--r--test-requirements.txt2
-rw-r--r--tox.ini10
6 files changed, 14 insertions, 9 deletions
diff --git a/.gitignore b/.gitignore
index 65e0127..31abd6d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -3,7 +3,7 @@
build
dist
heat_cfntools.egg-info/
-.testrepository/
+.stestr/
subunit.log
.tox
AUTHORS
diff --git a/.stestr.conf b/.stestr.conf
new file mode 100644
index 0000000..7458bd2
--- /dev/null
+++ b/.stestr.conf
@@ -0,0 +1,3 @@
+[DEFAULT]
+test_path=./heat_cfntools/tests
+top_dir=./
diff --git a/.testr.conf b/.testr.conf
deleted file mode 100644
index 8528c86..0000000
--- a/.testr.conf
+++ /dev/null
@@ -1,4 +0,0 @@
-[DEFAULT]
-test_command=OS_STDOUT_CAPTURE=1 OS_STDERR_CAPTURE=1 OS_TEST_TIMEOUT=60 ${PYTHON:-python} -m subunit.run discover -t ./ ./heat_cfntools/tests $LISTOPT $IDOPTION
-test_id_option=--load-list $IDFILE
-test_list_option=--list
diff --git a/lower-constraints.txt b/lower-constraints.txt
index d884e51..260b010 100644
--- a/lower-constraints.txt
+++ b/lower-constraints.txt
@@ -4,5 +4,5 @@ mock==1.0
pbr==0.8
psutil==1.1.1
six==1.9.0
-testrepository==0.0.18
+stestr==2.0.0
testtools==0.9.34
diff --git a/test-requirements.txt b/test-requirements.txt
index 7a25edc..4550481 100644
--- a/test-requirements.txt
+++ b/test-requirements.txt
@@ -1,4 +1,4 @@
hacking>=0.9.0
mock>=1.0
-testrepository>=0.0.18
+stestr>=2.0.0
testtools>=0.9.34
diff --git a/tox.ini b/tox.ini
index ffe1237..aa31c5b 100644
--- a/tox.ini
+++ b/tox.ini
@@ -6,7 +6,7 @@ setenv = VIRTUAL_ENV={envdir}
install_command = pip install -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt} {opts} {packages}
deps = -r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
-commands = python setup.py testr --slowest --testr-args='{posargs}'
+commands = stestr run --slowest {posargs}
[testenv:pep8]
basepython = python3
@@ -21,8 +21,14 @@ commands = bash tools/lintstack.sh
[testenv:cover]
basepython = python3
+setenv =
+ {[testenv]setenv}
+ PYTHON=coverage run --source heat_cfntools --parallel-mode
commands =
- python setup.py testr --coverage --testr-args='{posargs}'
+ stestr run {posargs}
+ coverage combine
+ coverage html -d cover
+ coverage xml -o cover/coverage.xml
[testenv:venv]
basepython = python3