Move from testr to stestr

Running `python setup.py test` and similar commands is no longer
supported by setuptools. These rely on testr anyway which has been
replaced by stestr in most places. Just switch to using stestr to avoid
these problems.

Note that we drop the coverage tox target since that requires a bit more
effort to setup now, but this was not used in CI and probably isn't
super important for a tool like grafyaml. It can be added back in if a
need arises in the future.

Change-Id: I86039d1d143b0199285d9195a3582640d447b36e
This commit is contained in:
Clark Boylan 2023-09-19 10:55:31 -07:00
parent fee8026623
commit fda05305bd
3 changed files with 6 additions and 10 deletions

3
.stestr.conf Normal file
View File

@ -0,0 +1,3 @@
[DEFAULT]
test_path=${TESTS_DIR:-./tests/}
top_dir=./

View File

@ -4,13 +4,11 @@
flake8
coverage>=3.6
python-subunit>=0.0.18
requests-mock>=0.6.0
sphinx!=1.6.6,!=1.6.7,!=2.1.0,>=1.6.2 # BSD
mock>=1.2
openstackdocstheme>=1.11.0 # Apache-2.0
oslotest>=1.2.0 # Apache-2.0
testrepository>=0.0.18
stestr>=1.0.0 # Apache-2.0
testscenarios>=0.4
testtools>=0.9.36,!=1.2.0

View File

@ -9,7 +9,8 @@ setenv =
VIRTUAL_ENV={envdir}
deps = -r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
commands = python setup.py test --slowest --testr-args='{posargs}'
commands =
stestr run {posargs}
[testenv:pep8]
commands = flake8
@ -17,12 +18,6 @@ commands = flake8
[testenv:venv]
commands = {posargs}
[testenv:cover]
commands =
coverage erase
python setup.py test --coverage --coverage-package-name=grafana_dashboards --testr-args='{posargs}'
coverage report
[testenv:docs]
commands = sphinx-build -W -E -b html doc/source doc/build/html