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: I28a842859279595eb66f372eff84945cf0828be9
Co-Authored-By: zhurong <aaronzhu1121@gmail.com>
This commit is contained in:
Ha Manh Dong 2018-07-18 09:22:46 +07:00 committed by zhurong
parent f1b8460ed0
commit bf1c0c0876
7 changed files with 33 additions and 27 deletions

2
.gitignore vendored
View File

@ -27,5 +27,5 @@ AUTHORS
ChangeLog
tags
openstack_dashboard/dummydb.sqlite
.testrepository/
.stestr/
test

3
.stestr.conf Normal file
View File

@ -0,0 +1,3 @@
[DEFAULT]
test_path=./solumdashboard/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 solumdashboard/tests $LISTOPT $IDOPTION
test_id_option=--load-list $IDFILE
test_list_option=--list

View File

@ -14,7 +14,7 @@ cryptography==2.1.4
debtcollector==1.19.0
decorator==4.2.1
deprecation==2.0
Django==1.11.11
Django==1.11
django-appconf==1.0.2
django-babel==0.6.2
django-compressor==2.2
@ -105,7 +105,7 @@ sphinxcontrib-httpdomain==1.6.1
sphinxcontrib-pecanwsme==0.8.0
sphinxcontrib-websupport==1.0.1
stevedore==1.28.0
testrepository==0.0.20
stestr==2.0.0
testtools==2.3.0
traceback2==1.4.0
unittest2==1.1.0

View File

@ -1,18 +1,19 @@
# The order of packages is significant, because pip processes them in the order
# of appearance. Changing the order has an impact on the overall integration
# process, which may cause wedges in the gate later.
pbr!=2.1.0,>=2.0.0 # Apache-2.0
pbr!=2.1.0,>=3.1.1 # Apache-2.0
# Horizon Core Requirements
Django<2.0,>=1.11 # BSD
django-compressor>=2.0 # MIT
oslo.log>=3.36.0 # Apache-2.0
python-keystoneclient>=3.8.0 # Apache-2.0
python-solumclient>=1.2.7 # Apache-2.0
Django<2,>=1.11;python_version<'3.0' # BSD
Django<2.1,>=1.11;python_version>='3.0' # BSD
django-compressor>=2.2 # MIT
oslo.log>=3.37.0 # Apache-2.0
python-keystoneclient>=3.15.0 # Apache-2.0
python-solumclient>=2.6.1 # Apache-2.0
oslo.utils>=3.33.0 # Apache-2.0
oslo.utils>=3.36.0 # Apache-2.0
# message extraction
Babel!=2.4.0,>=2.3.4 # BSD
Babel>=2.5.3 # BSD
django-babel>=0.6.2 # BSD
horizon>=13.0.0 # Apache-2.0

View File

@ -3,17 +3,17 @@
# process, which may cause wedges in the gate later.
hacking!=0.13.0,<0.14,>=0.12.0 # Apache-2.0
coverage!=4.4,>=4.0 # Apache-2.0
coverage>=4.5.1 # Apache-2.0
mock>=2.0.0 # BSD
oslo.config>=5.2.0 # Apache-2.0
pylint==1.4.5 # GPLv2
selenium>=2.50.1 # Apache-2.0
testrepository>=0.0.18 # Apache-2.0/BSD
selenium>=3.11.0 # Apache-2.0
stestr>=2.0.0 # Apache-2.0
testtools>=2.2.0 # MIT
testtools>=2.3.0 # MIT
unittest2>=1.1.0 # BSD
sphinx!=1.6.6,!=1.6.7,>=1.6.2 # BSD
openstackdocstheme>=1.18.1 # Apache-2.0
sphinx!=1.6.6,!=1.6.7,>=1.6.5 # BSD
openstackdocstheme>=1.20.0 # Apache-2.0
sphinxcontrib-pecanwsme>=0.8.0 # Apache-2.0
sphinxcontrib-httpdomain>=1.3.0 # BSD
sphinxcontrib-httpdomain>=1.6.1 # BSD

13
tox.ini
View File

@ -13,11 +13,20 @@ deps =
-r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
commands = python setup.py testr --slowest --testr-args="--concurrency 1 {posargs}"
commands =
stestr run --concurrency 1 {posargs}
stestr slowest
[testenv:cover]
basepython = python3
commands = python setup.py testr --coverage --testr-args='--concurrency 1 {posargs}'
setenv =
{[testenv]setenv}
PYTHON=coverage run --source solumdashboard --parallel-mode
commands =
stestr run --concurrency 1 {posargs}
coverage combine
coverage html -d cover
coverage xml -o cover/coverage.xml
[testenv:makemessages]
basepython = python3