diff --git a/.gitignore b/.gitignore index ae6fcd48e..aa79ca550 100644 --- a/.gitignore +++ b/.gitignore @@ -28,6 +28,7 @@ setuptools*.egg/ !/.pylintrc !/.stestr.conf !/.testr.conf +.stestr/ # Files created by releasenotes build releasenotes/build diff --git a/.testr.conf b/.testr.conf deleted file mode 100644 index 7e156d765..000000000 --- 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:-./neutron_lib/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 f54decc23..792e907dd 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -11,6 +11,7 @@ python-subunit>=1.0.0 # Apache-2.0/BSD oslotest>=3.2.0 # Apache-2.0 os-testr>=1.0.0 # Apache-2.0 reno>=2.5.0 # Apache-2.0 +stestr>=1.0.0 # Apache-2.0 testresources>=2.0.0 # Apache-2.0/BSD testscenarios>=0.4 # Apache-2.0/BSD testtools>=2.2.0 # MIT diff --git a/tox.ini b/tox.ini index e8a7af67a..a0b7b3f8b 100644 --- a/tox.ini +++ b/tox.ini @@ -9,12 +9,15 @@ passenv = TRACE_FAILONLY install_command = pip install {opts} {packages} setenv = PYTHONWARNINGS=default::DeprecationWarning + OS_LOG_CAPTURE={env:OS_LOG_CAPTURE:true} + OS_STDOUT_CAPTURE={env:OS_STDOUT_CAPTURE:true} + OS_STDERR_CAPTURE={env:OS_STDERR_CAPTURE:true} deps = -c{env:UPPER_CONSTRAINTS_FILE:https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt} -r{toxinidir}/requirements.txt -r{toxinidir}/test-requirements.txt commands = - ostestr --regex '{posargs}' + stestr run {posargs} [testenv:pep8] commands = @@ -32,9 +35,14 @@ commands = sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasen commands = {posargs} [testenv:cover] +setenv = + {[testenv]setenv} + PYTHON=coverage run --source neutron_lib --parallel-mode commands = - python setup.py test --coverage --coverage-package-name=neutron_lib --testr-args='{posargs}' - coverage report + stestr run --no-subunit-trace {posargs} + coverage combine + coverage html -d cover + coverage xml -o cover/coverage.xml [testenv:docs] deps =