From 676195e00978109cf5e0388034efacd354785034 Mon Sep 17 00:00:00 2001 From: Sean McGinnis Date: Tue, 19 Sep 2017 16:48:17 -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: I11e43cff87cad20b9c880e276e20a04123f830fb --- .stestr.conf | 3 +++ .testr.conf | 8 -------- tox.ini | 14 +++++++++++--- 3 files changed, 14 insertions(+), 11 deletions(-) create mode 100644 .stestr.conf delete mode 100644 .testr.conf diff --git a/.stestr.conf b/.stestr.conf new file mode 100644 index 00000000000..7101d2b5592 --- /dev/null +++ b/.stestr.conf @@ -0,0 +1,3 @@ +[DEFAULT] +test_path=${OS_TEST_PATH:-./cinder/tests/unit} +top_dir=./ diff --git a/.testr.conf b/.testr.conf deleted file mode 100644 index f706ba7f8b7..00000000000 --- a/.testr.conf +++ /dev/null @@ -1,8 +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:-./cinder/tests/unit} $LISTOPT $IDOPTION - -test_id_option=--load-list $IDFILE -test_list_option=--list diff --git a/tox.ini b/tox.ini index 23691d4773d..379df93715c 100644 --- a/tox.ini +++ b/tox.ini @@ -9,6 +9,10 @@ envlist = py35,py27,compliance,pep8 setenv = VIRTUAL_ENV={envdir} PYTHONHASHSEED=0 PYTHONWARNINGS=default::DeprecationWarning + OS_STDOUT_CAPTURE=1 + OS_STDERR_CAPTURE=1 + OS_TEST_TIMEOUT=60 + OS_TEST_PATH=./cinder/tests/unit usedevelop = True install_command = pip install -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt} {opts} {packages} @@ -73,10 +77,14 @@ commands = bash tools/lintstack.sh [testenv:cover] # Also do not run test_coverage_ext tests while gathering coverage as those # tests conflict with coverage. +setenv = + {[testenv]setenv} + PYTHON=coverage run --source cinder --parallel-mode commands = - python setup.py testr --coverage \ - --testr-args='^(?!.*test.*coverage).*$' - coverage report + stestr run {posargs} + coverage combine + coverage html -d cover + coverage xml -o cover/coverage.xml [testenv:genconfig] sitepackages = False