From 818227c23f5444ca97b6286a92698fc29b570063 Mon Sep 17 00:00:00 2001 From: Clark Boylan Date: Thu, 18 Nov 2021 08:32:11 -0800 Subject: [PATCH] Update test tool to use stestr testrepository isn't maintained at this point but stestr is. Switch to stestr. Change-Id: I545cb1598cd232220aa4b61d0155ab5a2846fd29 --- .gitignore | 1 + .stestr.conf | 3 +++ .testr.conf | 7 ------- test-requirements.txt | 2 +- tox.ini | 16 +++++++++++++--- 5 files changed, 18 insertions(+), 11 deletions(-) create mode 100644 .stestr.conf delete mode 100644 .testr.conf diff --git a/.gitignore b/.gitignore index 73923ac..768dd14 100644 --- a/.gitignore +++ b/.gitignore @@ -26,6 +26,7 @@ pip-log.txt .tox nosetests.xml .testrepository +.stestr .venv # Translations diff --git a/.stestr.conf b/.stestr.conf new file mode 100644 index 0000000..d6709a7 --- /dev/null +++ b/.stestr.conf @@ -0,0 +1,3 @@ +[DEFAULT] +test_path=bindep/tests +top_dir=./ 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 1ac7481..10d9494 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -2,5 +2,5 @@ coverage>=3.6 fixtures>=0.3.12 mock>=2.0 # BSD python-subunit -testrepository>=0.0.13 +stestr>=1.0.0 # Apache-2.0 testtools>=0.9.27 diff --git a/tox.ini b/tox.ini index a4ed9c5..ef4d464 100644 --- a/tox.ini +++ b/tox.ini @@ -9,9 +9,12 @@ usedevelop = True basepython = python3 install_command = pip install -U {opts} {packages} setenv = VIRTUAL_ENV={envdir} -deps = -r{toxinidir}/test-requirements.txt +deps = + -r{toxinidir}/requirements.txt + -r{toxinidir}/test-requirements.txt commands = - python setup.py test --slowest --testr-args='{posargs}' + stestr run {posargs} + stestr slowest [testenv:pep8] basepython = python3 @@ -23,7 +26,14 @@ commands = flake8 commands = {posargs} [testenv:cover] -commands = python setup.py test --coverage --testr-args='{posargs}' +setenv = + {[testenv]setenv} + PYTHON=coverage run --source bindep --parallel-mode +commands = + stestr run {posargs} + coverage combine + coverage html -d cover + coverage xml -o cover/coverage.xml [testenv:docs] deps =