From 29f76e972ac6be0715ae7d7d0d5e7f9c4adcf7f3 Mon Sep 17 00:00:00 2001 From: Matthew Treinish Date: Wed, 13 Sep 2017 16:38:55 -0400 Subject: [PATCH] Fix test runner config issues with os-testr 1.0.0 The os-testr 1.0.0 release had a couple of required config changes due to it's internal usage of stestr. This commit fixes those by adding a .stestr.conf (to remove a warning) sets the fixture env variables in the tox.ini instead of being hidden in .testr.conf and removing the quotes around posargs to make passing args to ostestr actually work. Also to keep the expected dev experience stestr is used directly for places where ostestr was called directly. Change-Id: Ib0fbcb2e7710a6b8219c56ef2a4462c61ea498a9 --- .gitignore | 1 + .stestr.conf | 4 ++++ tox.ini | 13 ++++++++----- 3 files changed, 13 insertions(+), 5 deletions(-) create mode 100644 .stestr.conf diff --git a/.gitignore b/.gitignore index 941cdc6ad..17e49b7b9 100644 --- a/.gitignore +++ b/.gitignore @@ -13,6 +13,7 @@ .project .pydevproject .ropeproject +.stestr/ .testrepository/ .tox .idea diff --git a/.stestr.conf b/.stestr.conf new file mode 100644 index 000000000..feb172371 --- /dev/null +++ b/.stestr.conf @@ -0,0 +1,4 @@ +[DEFAULT] +test_path=${OS_TEST_PATH:-./nova/tests} +top_dir=./ +group_regex=nova\.tests\.functional\.api\.openstack\.placement\.test_placement_api(?:\.|_)([^_]+) diff --git a/tox.ini b/tox.ini index 869d2edb9..e00693dc2 100644 --- a/tox.ini +++ b/tox.ini @@ -15,6 +15,9 @@ setenv = VIRTUAL_ENV={envdir} OS_TEST_PATH=./nova/tests/unit LANGUAGE=en_US LC_ALL=en_US.utf-8 + OS_STDOUT_CAPTURE=1 + OS_STDERR_CAPTURE=1 + OS_TEST_TIMEOUT=160 deps = -r{toxinidir}/test-requirements.txt commands = find . -type f -name "*.pyc" -delete @@ -26,13 +29,13 @@ passenv = OS_DEBUG GENERATE_HASHES [testenv:py27] commands = {[testenv]commands} - env TEST_OSPROFILER=1 ostestr --regex 'nova.tests.unit.test_profiler' - ostestr '{posargs}' + env TEST_OSPROFILER=1 stestr run 'nova.tests.unit.test_profiler' + stestr run {posargs} [testenv:py35] commands = {[testenv]commands} - env TEST_OSPROFILER=1 ostestr --regex 'nova.tests.unit.test_profiler' + env TEST_OSPROFILER=1 stestr run 'nova.tests.unit.test_profiler' bash tools/pretty_tox3.sh '{posargs}' [testenv:pep8] @@ -64,7 +67,7 @@ setenv = VIRTUAL_ENV={envdir} LANGUAGE=en_US commands = find . -type f -name "*.pyc" -delete - ostestr '{posargs}' + stestr run {posargs} # TODO(gcb) Merge this into [testenv:functional] when functional tests are gating # with python 3.5 @@ -87,7 +90,7 @@ setenv = VIRTUAL_ENV={envdir} LANGUAGE=en_US commands = find . -type f -name "*.pyc" -delete - ostestr '{posargs}' + stestr run {posargs} [testenv:genconfig] commands = oslo-config-generator --config-file=etc/nova/nova-config-generator.conf