From 556a43ef3193a1fa5ea127c64f98c0d5e9972afa Mon Sep 17 00:00:00 2001 From: Anand Bhat Date: Sun, 18 Jul 2021 00:05:10 +0530 Subject: [PATCH] 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 --- .gitignore | 2 +- .stestr.conf | 3 +++ .testr.conf | 7 ------- test-requirements.txt | 2 +- tox.ini | 15 +++++++++++++-- 5 files changed, 18 insertions(+), 11 deletions(-) create mode 100644 .stestr.conf delete mode 100644 .testr.conf diff --git a/.gitignore b/.gitignore index a672aea..9437483 100644 --- a/.gitignore +++ b/.gitignore @@ -25,7 +25,7 @@ pip-log.txt .coverage .tox nosetests.xml -.testrepository +.stestr/ .venv # Translations diff --git a/.stestr.conf b/.stestr.conf new file mode 100644 index 0000000..daf731d --- /dev/null +++ b/.stestr.conf @@ -0,0 +1,3 @@ +[DEFAULT] +test_path=./vitrage_dashboard/dashboard/tests/ +top_dir=./ \ No newline at end of file diff --git a/.testr.conf b/.testr.conf deleted file mode 100644 index 6d83b3c..0000000 --- a/.testr.conf +++ /dev/null @@ -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 diff --git a/test-requirements.txt b/test-requirements.txt index 7509d70..f1e3320 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -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 diff --git a/tox.ini b/tox.ini index e555016..e57df1d 100644 --- a/tox.ini +++ b/tox.ini @@ -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