Skip to content

Commit

Permalink
Remove single quotes from posargs on stestr run commands
Browse files Browse the repository at this point in the history
This commit removes the single quotes from all the stestr run commands
in the tox.ini. These were originally added as a workaround from the
ostestr days to ensure people could run a subset of tests with a regex
like:

  tox -epy27 regex

With the switch to stestr this is no longer needed because stestr treats
extra arguments as a filter regex. Quoting the posargs has a negative
effect because '--' parameters are treated as a string on input instead
of a parameter.

Fixing this also uncovered another issue in the stestr commands for the
functional jobs. The CLI arg for stestr versions <=1.1.0 is
--group_regex not --group-regex. This commit fixes this to make those
jobs pass without the quotes.

Change-Id: I512a517fa6890b29de24060376b4d7e061dc3add
  • Loading branch information
mtreinish committed Feb 17, 2018
1 parent 90a92d3 commit 3b673dd
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@ passenv = OS_DEBUG GENERATE_HASHES
[testenv:py27]
commands =
{[testenv]commands}
stestr run '{posargs}'
stestr run {posargs}
env TEST_OSPROFILER=1 stestr run --combine --no-discover 'nova.tests.unit.test_profiler'
stestr slowest

[testenv:py35]
commands =
{[testenv]commands}
stestr run --blacklist-file=tests-py3.txt '{posargs}'
stestr run --blacklist-file=tests-py3.txt {posargs}
env TEST_OSPROFILER=1 stestr run --combine --no-discover 'nova.tests.unit.test_profiler'


Expand Down Expand Up @@ -73,7 +73,7 @@ commands =
# special way. See the following for more details.
# http://stestr.readthedocs.io/en/latest/MANUAL.html#grouping-tests
# https://gabbi.readthedocs.io/en/latest/#purpose
stestr --test-path=./nova/tests/functional --group-regex=nova\.tests\.functional\.api\.openstack\.placement\.test_placement_api(?:\.|_)([^_]+) run '{posargs}'
stestr --test-path=./nova/tests/functional --group_regex=nova\.tests\.functional\.api\.openstack\.placement\.test_placement_api(?:\.|_)([^_]+) run {posargs}
stestr slowest

# TODO(gcb) Merge this into [testenv:functional] when functional tests are gating
Expand All @@ -92,7 +92,7 @@ commands =
# special way. See the following for more details.
# http://stestr.readthedocs.io/en/latest/MANUAL.html#grouping-tests
# https://gabbi.readthedocs.io/en/latest/#purpose
stestr --test-path=./nova/tests/functional --group-regex=nova\.tests\.functional\.api\.openstack\.placement\.test_placement_api(?:\.|_)([^_]+) run '{posargs}'
stestr --test-path=./nova/tests/functional --group_regex=nova\.tests\.functional\.api\.openstack\.placement\.test_placement_api(?:\.|_)([^_]+) run {posargs}

[testenv:api-samples]
usedevelop = True
Expand All @@ -101,7 +101,7 @@ setenv = {[testenv]setenv}
PYTHONHASHSEED=0
commands =
find . -type f -name "*.pyc" -delete
stestr --test-path=./nova/tests/functional/api_sample_tests run '{posargs}'
stestr --test-path=./nova/tests/functional/api_sample_tests run {posargs}
stestr slowest

[testenv:genconfig]
Expand All @@ -118,7 +118,7 @@ setenv = {[testenv]setenv}
commands =
coverage erase
find . -type f -name "*.pyc" -delete
stestr run '{posargs}'
stestr run {posargs}
coverage combine
coverage html -d cover
coverage xml -o cover/coverage.xml
Expand Down

0 comments on commit 3b673dd

Please sign in to comment.