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: Ib6985475a257570c2df000dfcabb8600afc11f4f
This commit is contained in:
Ha Manh Dong 2018-07-18 10:38:17 +07:00
parent afb6d8bbeb
commit 25705e4da3
5 changed files with 7 additions and 11 deletions

4
.gitignore vendored
View File

@ -25,7 +25,7 @@ pip-log.txt
.coverage
.tox
nosetests.xml
.testrepository
.stestr/
# Translations
*.mo
@ -48,4 +48,4 @@ ChangeLog
# Editors
*~
.*.swp
.*.swp

3
.stestr.conf Normal file
View File

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

View File

@ -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:-60} \
${PYTHON:-python} -m subunit.run discover -t ./ . $LISTOPT $IDOPTION
test_id_option=--load-list $IDFILE
test_list_option=--list

View File

@ -1,6 +1,6 @@
oslosphinx
pbr>=0.6,<1.0
sphinx>=1.1.2,<1.2
testrepository>=0.0.18
stestr>=2.0.0 # Apache-2.0
testtools>=0.9.34
yasfb>=0.5.1

View File

@ -8,7 +8,7 @@ usedevelop = True
setenv = VIRTUAL_ENV={envdir}
install_command = pip install -U {opts} {packages}
deps = -r{toxinidir}/requirements.txt
commands = python setup.py testr --slowest --testr-args='{posargs}'
commands = stestr run --slowest {posargs}
[testenv:venv]
commands = {posargs}