From e27bb7efdb514cec290dbf8b62db389de2efb925 Mon Sep 17 00:00:00 2001 From: Ben Nemec Date: Wed, 24 Apr 2019 17:19:00 +0000 Subject: [PATCH] Switch to stestr It works better and pbr will at some point drop support for running tests via setup.py. Change-Id: I44250d8c65af932e035c7ab6fc08f1135a15ab93 --- .gitignore | 3 +-- .stestr.conf | 3 +++ .testr.conf | 7 ------- test-requirements.txt | 4 +++- tox.ini | 11 +++++++++-- 5 files changed, 16 insertions(+), 12 deletions(-) create mode 100644 .stestr.conf delete mode 100644 .testr.conf diff --git a/.gitignore b/.gitignore index 46b5d5b..9a90fad 100644 --- a/.gitignore +++ b/.gitignore @@ -27,8 +27,7 @@ pip-log.txt # Unit test / coverage reports .coverage .tox -nosetests.xml -.testrepository +.stestr # Translations *.mo diff --git a/.stestr.conf b/.stestr.conf new file mode 100644 index 0000000..684a532 --- /dev/null +++ b/.stestr.conf @@ -0,0 +1,3 @@ +[DEFAULT] +test_path=./reviewstats/tests +top_path=./ diff --git a/.testr.conf b/.testr.conf deleted file mode 100644 index fb62267..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 \ No newline at end of file diff --git a/test-requirements.txt b/test-requirements.txt index 1b70fc4..e6e9d49 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -3,7 +3,9 @@ hacking!=0.13.0,<0.14,>=0.12.0 # Apache-2.0 coverage>=3.6 fixtures>=0.3.14 python-subunit -testrepository>=0.0.17 +sphinx>=1.1.2,<1.2 +oslo.sphinx +stestr>=2.0.0 testscenarios>=0.4,<0.5 testtools>=0.9.32 mock diff --git a/tox.ini b/tox.ini index affae0b..2fb17e6 100644 --- a/tox.ini +++ b/tox.ini @@ -10,7 +10,7 @@ setenv = VIRTUAL_ENV={envdir} deps = -r{toxinidir}/requirements.txt -r{toxinidir}/test-requirements.txt -commands = python setup.py testr --slowest --testr-args='{posargs}' +commands = stestr run --slowest {posargs} [testenv:docs] basepython = python3 @@ -24,7 +24,14 @@ commands = flake8 commands = {posargs} [testenv:cover] -commands = python setup.py testr --coverage --testr-args='{posargs}' +commands = + coverage erase + {[testenv]commands} + coverage combine + coverage html -d cover + coverage xml -o cover/coverage.xml + coverage report --show-missing + [flake8] show-source = True