From 0f28a482d57fe0eb2c02d7eabf6f57fe03bec9b1 Mon Sep 17 00:00:00 2001 From: Michael Johnson Date: Wed, 23 May 2018 16:22:45 -0700 Subject: [PATCH] Migrate to stestr This patch updates tox.ini to use stestr instead of testr. Change-Id: I6be57c0c90d7711c172243b9de43034735334de7 --- .testr.conf | 7 ------- test-requirements.txt | 2 +- tox.ini | 17 +++++++++++++++-- 3 files changed, 16 insertions(+), 10 deletions(-) delete mode 100644 .testr.conf diff --git a/.testr.conf b/.testr.conf deleted file mode 100644 index 6d83b3c4..00000000 --- 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 8ad59620..47c128f1 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -7,6 +7,6 @@ hacking!=0.13.0,<0.14,>=0.12.0 # Apache-2.0 coverage!=4.4,>=4.0 # Apache-2.0 python-subunit>=1.0.0 # Apache-2.0/BSD oslotest>=3.2.0 # Apache-2.0 -testrepository>=0.0.18 # Apache-2.0/BSD +stestr>=2.0.0 # Apache-2.0 testscenarios>=0.4 # Apache-2.0/BSD testtools>=2.2.0 # MIT diff --git a/tox.ini b/tox.ini index f168afd1..70b834d0 100644 --- a/tox.ini +++ b/tox.ini @@ -10,7 +10,9 @@ setenv = VIRTUAL_ENV={envdir} PYTHONWARNINGS=default::DeprecationWarning deps = -r{toxinidir}/test-requirements.txt -commands = python setup.py test --slowest --testr-args='{posargs}' +commands = + stestr run {posargs} + stestr slowest [testenv:pep8] commands = flake8 {posargs} @@ -19,7 +21,18 @@ commands = flake8 {posargs} commands = {posargs} [testenv:cover] -commands = python setup.py test --coverage --testr-args='{posargs}' +setenv = + {[testenv]setenv} + PYTHON=coverage run --source octavia_tempest_plugin --parallel-mode +whitelist_externals = + find +commands = + find octavia_tempest_plugin -type f -name "*.pyc" -delete + coverage erase + stestr run {posargs} + coverage combine + coverage html -d cover + coverage xml -o cover/coverage.xml [testenv:docs] deps =