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
This commit is contained in:
Ha Manh Dong 2018-07-18 20:14:05 -04:00 committed by Zane Bitter
parent d6f8cda665
commit 97aec93e2b
6 changed files with 14 additions and 9 deletions

2
.gitignore vendored
View File

@ -3,7 +3,7 @@
build
dist
heat_cfntools.egg-info/
.testrepository/
.stestr/
subunit.log
.tox
AUTHORS

3
.stestr.conf Normal file
View File

@ -0,0 +1,3 @@
[DEFAULT]
test_path=./heat_cfntools/tests
top_dir=./

View File

@ -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

View File

@ -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

View File

@ -1,4 +1,4 @@
hacking>=0.9.0
mock>=1.0
testrepository>=0.0.18
stestr>=2.0.0
testtools>=0.9.34

10
tox.ini
View File

@ -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