Merge "Switch to use stestr for unit test"

This commit is contained in:
Zuul 2018-07-20 08:37:10 +00:00 committed by Gerrit Code Review
commit db1539fb41
5 changed files with 14 additions and 8 deletions

2
.gitignore vendored
View File

@ -8,7 +8,7 @@ build
cover
htmlcov
.secret_key_store
.testrepository
.stestr/
.venv
dist
*.egg

3
.stestr.conf Normal file
View File

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

View File

@ -1,4 +0,0 @@
[DEFAULT]
test_command=${PYTHON:-python} -m subunit.run discover -t ./ ./cloudkittydashboard/tests $LISTOPT $IDOPTION
test_id_option=--load-list $IDFILE
test_list_option=--list

View File

@ -9,7 +9,7 @@ python-subunit>=0.0.18
sphinx>=1.6.2 # BSD
openstackdocstheme>=1.11.0 # Apache-2.0
oslotest>=1.10.0 # Apache-2.0
testrepository>=0.0.18
stestr>=2.0.0 # Apache-2.0
testscenarios>=0.4
testtools>=1.4.0
reno>=1.8.0 # Apache2

11
tox.ini
View File

@ -10,7 +10,7 @@ setenv =
VIRTUAL_ENV={envdir}
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]
commands = flake8
@ -19,7 +19,14 @@ commands = flake8
commands = {posargs}
[testenv:cover]
commands = python setup.py testr --coverage --testr-args='{posargs}'
setenv =
{[testenv]setenv}
PYTHON=coverage run --source cloudkittydashboard --parallel-mode
commands =
stestr run {posargs}
coverage combine
coverage html -d cover
coverage xml -o cover/coverage.xml
[testenv:docs]
commands = python setup.py build_sphinx