From 9a741bac212f479b4a245dbd91962691cda35290 Mon Sep 17 00:00:00 2001 From: Sean McGinnis Date: Tue, 19 Sep 2017 16:51:09 -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: I15fd3427485ff26ee936cae622585745ba9281b7 --- .gitignore | 1 + .stestr.conf | 3 +++ .testr.conf | 7 ------- tox.ini | 13 ++++++++++++- 4 files changed, 16 insertions(+), 8 deletions(-) create mode 100644 .stestr.conf delete mode 100644 .testr.conf diff --git a/.gitignore b/.gitignore index aab565054..d114e6020 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ !.gitignore !.mailmap !.testr.conf +/.* *.py[cod] diff --git a/.stestr.conf b/.stestr.conf new file mode 100644 index 000000000..30f5565d5 --- /dev/null +++ b/.stestr.conf @@ -0,0 +1,3 @@ +[DEFAULT] +test_path=${OS_TEST_PATH:-./os_brick/tests} +top_dir=./ diff --git a/.testr.conf b/.testr.conf deleted file mode 100644 index 6d83b3c4e..000000000 --- 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/tox.ini b/tox.ini index 37ee6ba3a..da5846768 100644 --- a/tox.ini +++ b/tox.ini @@ -10,6 +10,11 @@ setenv = BRANCH_NAME=master CLIENT_NAME=os-brick PYTHONHASHSEED=0 + OS_TEST_PATH=./os_brick/tests + OS_TEST_TIMEOUT=60 + OS_STDOUT_CAPTURE=1 + OS_STDERR_CAPTURE=1 + install_command = {toxinidir}/tools/tox_install.sh {env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt} {opts} {packages} deps = -r{toxinidir}/requirements.txt -r{toxinidir}/test-requirements.txt @@ -48,8 +53,14 @@ commands = {posargs} [testenv:cover] # To see the report of missing coverage add to commands # coverage report --show-missing +setenv = + {[testenv]setenv} + PYTHON=coverage run --source os_brick --parallel-mode commands = - python setup.py test --coverage --coverage-package-name=os_brick --testr-args='{posargs}' + stestr run {posargs} + coverage combine + coverage html -d cover + coverage xml -o cover/coverage/xml [testenv:docs] commands = python setup.py build_sphinx