|
 |
a64660 |
From 97aec93e2b2c0d2dc6a0d7ddddba962dee007cec Mon Sep 17 00:00:00 2001
|
|
 |
a64660 |
From: Ha Manh Dong <donghm@vn.fujitsu.com>
|
|
 |
a64660 |
Date: Wed, 18 Jul 2018 20:14:05 -0400
|
|
 |
a64660 |
Subject: [PATCH 16/21] Switch to use stestr for unit test
|
|
 |
a64660 |
|
|
 |
a64660 |
According to Openstack summit session [1],
|
|
 |
a64660 |
stestr is maintained project to which all Openstack projects should migrate.
|
|
 |
a64660 |
So we should switch to stestr.
|
|
 |
a64660 |
|
|
 |
a64660 |
[1] https://etherpad.openstack.org/p/YVR-python-pti
|
|
 |
a64660 |
|
|
 |
a64660 |
Change-Id: I14ae3879465e622f36fd7bba3f04cb6e0cb7500e
|
|
 |
a64660 |
---
|
|
 |
a64660 |
.stestr.conf | 3 +++
|
|
 |
a64660 |
.testr.conf | 4 ----
|
|
 |
a64660 |
lower-constraints.txt | 2 +-
|
|
 |
a64660 |
test-requirements.txt | 2 +-
|
|
 |
a64660 |
tox.ini | 10 ++++++++--
|
|
 |
a64660 |
5 files changed, 14 insertions(+), 9 deletions(-)
|
|
 |
a64660 |
create mode 100644 .stestr.conf
|
|
 |
a64660 |
delete mode 100644 .testr.conf
|
|
 |
a64660 |
|
|
 |
a64660 |
diff --git a/.stestr.conf b/.stestr.conf
|
|
 |
a64660 |
new file mode 100644
|
|
 |
a64660 |
index 0000000..7458bd2
|
|
 |
a64660 |
--- /dev/null
|
|
 |
a64660 |
+++ b/.stestr.conf
|
|
 |
a64660 |
@@ -0,0 +1,3 @@
|
|
 |
a64660 |
+[DEFAULT]
|
|
 |
a64660 |
+test_path=./heat_cfntools/tests
|
|
 |
a64660 |
+top_dir=./
|
|
 |
a64660 |
diff --git a/.testr.conf b/.testr.conf
|
|
 |
a64660 |
deleted file mode 100644
|
|
 |
a64660 |
index 8528c86..0000000
|
|
 |
a64660 |
--- a/.testr.conf
|
|
 |
a64660 |
+++ /dev/null
|
|
 |
a64660 |
@@ -1,4 +0,0 @@
|
|
 |
a64660 |
-[DEFAULT]
|
|
 |
a64660 |
-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
|
|
 |
a64660 |
-test_id_option=--load-list $IDFILE
|
|
 |
a64660 |
-test_list_option=--list
|
|
 |
a64660 |
diff --git a/lower-constraints.txt b/lower-constraints.txt
|
|
 |
a64660 |
index d884e51..260b010 100644
|
|
 |
a64660 |
--- a/lower-constraints.txt
|
|
 |
a64660 |
+++ b/lower-constraints.txt
|
|
 |
a64660 |
@@ -4,5 +4,5 @@ mock==1.0
|
|
 |
a64660 |
pbr==0.8
|
|
 |
a64660 |
psutil==1.1.1
|
|
 |
a64660 |
six==1.9.0
|
|
 |
a64660 |
-testrepository==0.0.18
|
|
 |
a64660 |
+stestr==2.0.0
|
|
 |
a64660 |
testtools==0.9.34
|
|
 |
a64660 |
diff --git a/test-requirements.txt b/test-requirements.txt
|
|
 |
a64660 |
index 7a25edc..4550481 100644
|
|
 |
a64660 |
--- a/test-requirements.txt
|
|
 |
a64660 |
+++ b/test-requirements.txt
|
|
 |
a64660 |
@@ -1,4 +1,4 @@
|
|
 |
a64660 |
hacking>=0.9.0
|
|
 |
a64660 |
mock>=1.0
|
|
 |
a64660 |
-testrepository>=0.0.18
|
|
 |
a64660 |
+stestr>=2.0.0
|
|
 |
a64660 |
testtools>=0.9.34
|
|
 |
a64660 |
diff --git a/tox.ini b/tox.ini
|
|
 |
a64660 |
index ffe1237..aa31c5b 100644
|
|
 |
a64660 |
--- a/tox.ini
|
|
 |
a64660 |
+++ b/tox.ini
|
|
 |
a64660 |
@@ -6,7 +6,7 @@ setenv = VIRTUAL_ENV={envdir}
|
|
 |
a64660 |
install_command = pip install -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt} {opts} {packages}
|
|
 |
a64660 |
deps = -r{toxinidir}/requirements.txt
|
|
 |
a64660 |
-r{toxinidir}/test-requirements.txt
|
|
 |
a64660 |
-commands = python setup.py testr --slowest --testr-args='{posargs}'
|
|
 |
a64660 |
+commands = stestr run --slowest {posargs}
|
|
 |
a64660 |
|
|
 |
a64660 |
[testenv:pep8]
|
|
 |
a64660 |
basepython = python3
|
|
 |
a64660 |
@@ -21,8 +21,14 @@ commands = bash tools/lintstack.sh
|
|
 |
a64660 |
|
|
 |
a64660 |
[testenv:cover]
|
|
 |
a64660 |
basepython = python3
|
|
 |
a64660 |
+setenv =
|
|
 |
a64660 |
+ {[testenv]setenv}
|
|
 |
a64660 |
+ PYTHON=coverage run --source heat_cfntools --parallel-mode
|
|
 |
a64660 |
commands =
|
|
 |
a64660 |
- python setup.py testr --coverage --testr-args='{posargs}'
|
|
 |
a64660 |
+ stestr run {posargs}
|
|
 |
a64660 |
+ coverage combine
|
|
 |
a64660 |
+ coverage html -d cover
|
|
 |
a64660 |
+ coverage xml -o cover/coverage.xml
|
|
 |
a64660 |
|
|
 |
a64660 |
[testenv:venv]
|
|
 |
a64660 |
basepython = python3
|
|
 |
a64660 |
--
|
|
 |
a64660 |
2.20.1
|
|
 |
a64660 |
|