From fda05305bda8805a56a1a48e95d93e746fa51388 Mon Sep 17 00:00:00 2001 From: Clark Boylan Date: Tue, 19 Sep 2023 10:55:31 -0700 Subject: [PATCH] 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 --- .stestr.conf | 3 +++ test-requirements.txt | 4 +--- tox.ini | 9 ++------- 3 files changed, 6 insertions(+), 10 deletions(-) create mode 100644 .stestr.conf diff --git a/.stestr.conf b/.stestr.conf new file mode 100644 index 0000000..d9a8fc4 --- /dev/null +++ b/.stestr.conf @@ -0,0 +1,3 @@ +[DEFAULT] +test_path=${TESTS_DIR:-./tests/} +top_dir=./ diff --git a/test-requirements.txt b/test-requirements.txt index 601db9f..f9e4dc4 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -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 diff --git a/tox.ini b/tox.ini index 3966cce..92704b1 100644 --- a/tox.ini +++ b/tox.ini @@ -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