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 *.pyc
.testrepository/ .stestr/
.tox .tox
*.egg-info/ *.egg-info/
*.egg *.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 docutils>=0.11 # OSI-Approved Open Source, Public Domain
# required to build documentation # required to build documentation
sphinx>=1.6.2 # BSD sphinx>=1.6.2 # BSD
testrepository>=0.0.18 stestr>=1.1.0 # Apache-2.0
testtools>=0.9.34 testtools>=0.9.34
mock mock
coverage coverage

19
tox.ini
View File

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