Migrate from testr to stestr

* Replace .testr.conf by .stestr.conf for migration and update
  .gitignore,test-requirements files accordingly
* Use 3.18.0 as the minversion for tox

Change-Id: I6bf98adecb772896c6243a90271a1b258569a4df
This commit is contained in:
Anand Bhat 2021-07-18 00:05:10 +05:30
parent 0c56491a7e
commit 556a43ef31
5 changed files with 18 additions and 11 deletions

2
.gitignore vendored
View File

@ -25,7 +25,7 @@ pip-log.txt
.coverage
.tox
nosetests.xml
.testrepository
.stestr/
.venv
# Translations

3
.stestr.conf Normal file
View File

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

View File

@ -7,7 +7,7 @@ hacking>=3.0.1,<3.1.0 # Apache-2.0
coverage>=3.6
python-subunit>=0.0.18
nodeenv>=0.9.4 # BSD
testrepository>=0.0.18
stestr>=2.0.0 # Apache-2.0
testscenarios>=0.4
testtools>=1.4.0
pytest>=5.3.5 # MIT

15
tox.ini
View File

@ -1,5 +1,5 @@
[tox]
minversion = 2.3.2
minversion = 3.18.0
envlist = py3,pep8,npm
skipsdist = True
ignore_basepython_conflict = True
@ -54,7 +54,18 @@ deps =
commands = {posargs}
[testenv:cover]
commands = python setup.py test --coverage --testr-args='{posargs}'
allowlist_externals = find
setenv =
PYTHON=coverage run --source vitrage-dashboard --parallel-mode
commands =
coverage erase
find . -type f -name "*.pyc" -delete
stestr run {posargs}
coverage combine
coverage html -d cover
coverage xml -o cover/coverage.xml
coverage report
[testenv:docs]
deps = -r{toxinidir}/doc/requirements.txt