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
This commit is contained in:
Matthew Treinish 2017-09-13 16:38:55 -04:00
parent 96180c0080
commit 29f76e972a
3 changed files with 13 additions and 5 deletions

1
.gitignore vendored
View File

@ -13,6 +13,7 @@
.project
.pydevproject
.ropeproject
.stestr/
.testrepository/
.tox
.idea

4
.stestr.conf Normal file
View File

@ -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(?:\.|_)([^_]+)

13
tox.ini
View File

@ -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