From e571e1878f366a6ff2e1cadbb271a6b72c96a91f Mon Sep 17 00:00:00 2001 From: junboli Date: Mon, 9 Oct 2017 14:18:51 +0800 Subject: [PATCH] tests: replace .testr.conf with .stestr.conf TrivialFix:In the change[1] os_testr changed under the covers from using testr to stestr, so that we now get the following warning: ostestr.py:120: UserWarning: No .stestr.conf file found in the CWD. Please create one to to replace the .testr.conf. You can find a script to do this in the stestr git repository. So remove the .testr.conf and add .stestr.conf which was generated using a utility script as documented here [2]. [1] Id7cb2a39a8308f1413608dcf19273a1d7f33592e [2] https://media.readthedocs.org/pdf/stestr/stable/stestr.pdf Change-Id: I4810ac86aeca23e5abff3dc0417ffa3aa2f3a199 --- .gitignore | 3 ++- .stestr.conf | 3 +++ .testr.conf | 8 -------- tox.ini | 11 ++++++++++- 4 files changed, 15 insertions(+), 10 deletions(-) create mode 100644 .stestr.conf delete mode 100644 .testr.conf diff --git a/.gitignore b/.gitignore index 681ad1afd1..1117845da2 100644 --- a/.gitignore +++ b/.gitignore @@ -1,10 +1,11 @@ *.pyc *.log .glance-venv -.venv +.stestr/* .testrepository/ .tox .coverage* +.venv cover/* covhtml nosetests.xml diff --git a/.stestr.conf b/.stestr.conf new file mode 100644 index 0000000000..663a923640 --- /dev/null +++ b/.stestr.conf @@ -0,0 +1,3 @@ +[DEFAULT] +test_path=${TEST_PATH:-./glance/tests} +top_dir=./ diff --git a/.testr.conf b/.testr.conf deleted file mode 100644 index b3a5d372ad..0000000000 --- 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:-160} \ - ${PYTHON:-python} -m subunit.run discover -t ./ ${OS_TEST_PATH:-./glance/tests} $LISTOPT $IDOPTION - -test_id_option=--load-list $IDFILE -test_list_option=--list diff --git a/tox.ini b/tox.ini index 03e3b6bdc8..7c8b974d3a 100644 --- a/tox.ini +++ b/tox.ini @@ -24,7 +24,6 @@ install_command = pip install -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstac deps = -r{toxinidir}/test-requirements.txt commands = bandit: bandit -c bandit.yaml -r glance -n5 -p gate - cover: python setup.py testr --coverage --testr-args='^(?!.*test.*coverage).*$' debug: oslo_debug_helper {posargs} debug{-py27,-py35}: oslo_debug_helper {posargs} docs: python setup.py build_sphinx @@ -43,6 +42,16 @@ commands = ostestr --slowest {posargs} # conditionals in [testenv], use separate environment. commands = ostestr --slowest {posargs} +[testenv:cover] +setenv = + {[testenv]setenv} + PYTHON=coverage run --source glance --parallel-mode +commands = + stestr run {posargs} + coverage combine + coverage html -d cover + coverage xml -o cover/coverage.xml + [testenv:pep8] commands = flake8 {posargs}