From 574fd4d3ef4545db7bd16c23ff52f8d61256c812 Mon Sep 17 00:00:00 2001 From: Ben Nemec Date: Thu, 13 Sep 2018 15:50:37 +0000 Subject: [PATCH] Migrate to stestr --- .gitignore | 3 +-- .testr.conf | 7 ------- doc/source/conf.py | 2 +- test-requirements.txt | 1 + tox.ini | 22 +++++++++++++++++++--- 5 files changed, 22 insertions(+), 13 deletions(-) delete mode 100644 .testr.conf diff --git a/.gitignore b/.gitignore index dfe851d..d6778fa 100644 --- a/.gitignore +++ b/.gitignore @@ -24,8 +24,7 @@ pip-log.txt # Unit test / coverage reports .coverage .tox -nosetests.xml -.testrepository +.stestr/ # Translations *.mo diff --git a/.testr.conf b/.testr.conf deleted file mode 100644 index 707dccf..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 ./ ./oslo_upgradecheck $LISTOPT $IDOPTION -test_id_option=--load-list $IDFILE -test_list_option=--list diff --git a/doc/source/conf.py b/doc/source/conf.py index c10592a..43b1ef8 100755 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -38,7 +38,7 @@ master_doc = 'index' # General information about the project. project = u'oslo.upgradecheck' -copyright = u'2014, OpenStack Foundation' +copyright = u'2018, Red Hat Inc.' # If true, '()' will be appended to :func: etc. cross-reference text. add_function_parentheses = True diff --git a/test-requirements.txt b/test-requirements.txt index 88ac441..b12a8d1 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -4,6 +4,7 @@ hacking<0.11,>=0.10.0 oslotest>=1.5.1 +stestr>=2.0.0 # These are needed for docs generation oslosphinx>=2.5.0 diff --git a/tox.ini b/tox.ini index 17f7932..b5b92e8 100644 --- a/tox.ini +++ b/tox.ini @@ -11,7 +11,7 @@ install_command = setenv = VIRTUAL_ENV={envdir} deps = -r{toxinidir}/test-requirements.txt -commands = python setup.py test --slowest --testr-args='{posargs}' +commands = stestr run --slowest {posargs} [testenv:common-constraints] install_command = pip install -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt} {opts} {packages} @@ -31,11 +31,27 @@ install_command = {[testenv:common-constraints]install_command} commands = {posargs} [testenv:cover] -commands = python setup.py test --coverage --testr-args='{posargs}' +deps = {[testenv]deps} + coverage +setenv = + PYTHON=coverage run --source $project --parallel-mode +commands = + stestr run '{posargs}' + coverage combine + coverage html -d cover + coverage xml -o cover/coverage.xml [testenv:cover-constraints] install_command = {[testenv:common-constraints]install_command} -commands = python setup.py test --coverage --testr-args='{posargs}' +deps = {[testenv]deps} + coverage +setenv = + PYTHON=coverage run --source $project --parallel-mode +commands = + stestr run '{posargs}' + coverage combine + coverage html -d cover + coverage xml -o cover/coverage.xml [testenv:docs] commands = sphinx-build -W -b html doc/source doc/build/html