From 606525327e658d1764e0b99acc5b8058801bf844 Mon Sep 17 00:00:00 2001 From: Sean McGinnis Date: Tue, 19 Sep 2017 16:51:32 -0500 Subject: [PATCH] Add .stestr.conf configuration os-testr has moved over to use stestr instead of testr. While this is usually compaible with existing settings, there is a warning that is emitted when .stestr.conf is not present. It is usually able to fall back to parsing the .testr.conf file, but to be more correct and to prevent future problems we should update the config. Change-Id: I203b3bde40029e4ffc48271becfa1f7a8ce4b1f7 --- .gitignore | 2 ++ .stestr.conf | 3 +++ .testr.conf | 9 --------- test-requirements.txt | 1 + tox.ini | 15 +++++++++++++-- 5 files changed, 19 insertions(+), 11 deletions(-) create mode 100644 .stestr.conf delete mode 100644 .testr.conf diff --git a/.gitignore b/.gitignore index 6ee849a..c79e153 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ *.py[cod] +/.* # C extensions *.so @@ -28,6 +29,7 @@ pip-log.txt nosetests.xml .testrepository .venv +cover # Translations *.mo diff --git a/.stestr.conf b/.stestr.conf new file mode 100644 index 0000000..ca39580 --- /dev/null +++ b/.stestr.conf @@ -0,0 +1,3 @@ +[DEFAULT] +test_path=${OS_TEST_PATH:-./brick_cinderclient_ext/tests/unit} +top_dir=./ diff --git a/.testr.conf b/.testr.conf deleted file mode 100644 index a4c4b65..0000000 --- a/.testr.conf +++ /dev/null @@ -1,9 +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 ./ ${OS_TEST_PATH:-./brick_cinderclient_ext/tests/unit} \ - $LISTOPT $IDOPTION -test_id_option=--load-list $IDFILE -test_list_option=--list diff --git a/test-requirements.txt b/test-requirements.txt index 2b21eec..576c134 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -15,3 +15,4 @@ reno>=2.5.0 # Apache-2.0 testrepository>=0.0.18 # Apache-2.0/BSD testscenarios>=0.4 # Apache-2.0/BSD testtools>=1.4.0 # MIT +os-testr>=1.0.0 # Apache-2.0 diff --git a/tox.ini b/tox.ini index 4d219ae..c4e6452 100644 --- a/tox.ini +++ b/tox.ini @@ -7,13 +7,17 @@ skipsdist = True usedevelop = True install_command = pip install -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt} {opts} {packages} setenv = VIRTUAL_ENV={envdir} + OS_STDOUT_CAPTURE=1 + OS_STDERR_CAPTURE=1 + OS_TEST_TIMEOUT=60 + OS_TEST_PATH=./brick_cinderclient_ext/tests/unit passenv = *_proxy *_PROXY deps = -r{toxinidir}/requirements.txt -r{toxinidir}/test-requirements.txt commands = find . -type f -name "*.pyc" -delete - python setup.py testr --testr-args='{posargs}' + ostestr {posargs} whitelist_externals = find [testenv:pep8] @@ -32,7 +36,14 @@ setenv = passenv = OS_* [testenv:cover] -commands = python setup.py test --coverage --testr-args='{posargs}' +setenv = + {[testenv]setenv} + PYTHON=coverage run --source brick_cinderclient_ext --parallel-mode +commands = + stestr run {posargs} + coverage combine + coverage html -d cover + coverage xml -o cover/coverage.xml [testenv:docs] commands = python setup.py build_sphinx