Switch to stestr for running unit tests

* As stestr is the successor of testr, it's time to switch to
  stestr for running refstack unit tests.

Change-Id: I3b9c0e2b4363dec24bad43bf5cfbeef4ecc7a37c
This commit is contained in:
Chandan Kumar 2017-12-05 12:20:22 +05:30
parent d8ff820765
commit d159cc379e
5 changed files with 15 additions and 15 deletions

2
.gitignore vendored
View File

@ -1,5 +1,5 @@
*.pyc
.testrepository/
.stestr/
.tox
*.egg-info/
*.egg

3
.stestr.conf Normal file
View File

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

View File

@ -1,4 +0,0 @@
[DEFAULT]
test_command=OS_STDOUT_CAPTURE=1 OS_STDERR_CAPTURE=1 coverage run -m subunit.run discover -t ./ -s ./refstack_client/tests/unit $LISTOPT $IDOPTION
test_id_option=--load-list $IDFILE
test_list_option=--list

View File

@ -4,7 +4,7 @@ flake8==2.0
docutils>=0.11 # OSI-Approved Open Source, Public Domain
# required to build documentation
sphinx>=1.6.2 # BSD
testrepository>=0.0.18
stestr>=1.1.0 # Apache-2.0
testtools>=0.9.34
mock
coverage

19
tox.ini
View File

@ -12,8 +12,8 @@ setenv = VIRTUAL_ENV={envdir}
LC_ALL=C
deps = -r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
commands = /bin/rm -f .testrepository/times.dbm
python setup.py testr --testr-args='{posargs}'
commands =
stestr --test-path ./refstack_client/tests/unit run {posargs}
distribute = false
[testenv:pep8]
@ -25,13 +25,14 @@ distribute = false
commands = {posargs}
[testenv:cover]
commands = coverage run \
--include './refstack_client/*' \
--omit './refstack_client/tests*' \
-m testtools.run discover refstack_client.tests.unit
coverage report
coverage html -d cover
/bin/rm .coverage
commands =
coverage erase
find . -type f -name "*.pyc" -delete
stestr --test-path ./refstack_client/tests run {posargs}
coverage combine
coverage html -d cover
coverage xml -o cover/coverage.xml
coverage report
[testenv:docs]
commands = python setup.py build_sphinx {posargs}