Browse Source

Switch to stestr

It works better and pbr will at some point drop support for running
tests via setup.py.

Change-Id: I44250d8c65af932e035c7ab6fc08f1135a15ab93
changes/06/655506/7
Ben Nemec 3 years ago committed by Natal Ngétal
parent
commit
e27bb7efdb
  1. 3
      .gitignore
  2. 3
      .stestr.conf
  3. 7
      .testr.conf
  4. 4
      test-requirements.txt
  5. 11
      tox.ini

3
.gitignore vendored

@ -27,8 +27,7 @@ pip-log.txt
# Unit test / coverage reports
.coverage
.tox
nosetests.xml
.testrepository
.stestr
# Translations
*.mo

3
.stestr.conf

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

7
.testr.conf

@ -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

4
test-requirements.txt

@ -3,7 +3,9 @@ hacking!=0.13.0,<0.14,>=0.12.0 # Apache-2.0
coverage>=3.6
fixtures>=0.3.14
python-subunit
testrepository>=0.0.17
sphinx>=1.1.2,<1.2
oslo.sphinx
stestr>=2.0.0
testscenarios>=0.4,<0.5
testtools>=0.9.32
mock

11
tox.ini

@ -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:docs]
basepython = python3
@ -24,7 +24,14 @@ commands = flake8
commands = {posargs}
[testenv:cover]
commands = python setup.py testr --coverage --testr-args='{posargs}'
commands =
coverage erase
{[testenv]commands}
coverage combine
coverage html -d cover
coverage xml -o cover/coverage.xml
coverage report --show-missing
[flake8]
show-source = True

Loading…
Cancel
Save