Skip to content

Commit

Permalink
Set regex flag on ostestr command for osprofiler tests
Browse files Browse the repository at this point in the history
In the unit test tox jobs we run the whole test suite first and after
that exits successfully we also run the osprofiler tests while setting
an osprofiler env variable to enable osprofiler. However the regex isn't
being set properly in ostestr, you set the selection regex with the
--regex flag. [1] This only works by chance because ostestr will pass
any unrecognized args to the subprocess used to run testr internally,
and testr leverages that as a regex. But in the latest os-testr release
it doesn't subprocess internally anymore and this doesn't work. This
commit fixes things to properly set the regex in ostestr so it works in
both old and new versions.

The order of the test runs is also switched because we capture the last
test run's subunit for openstack-health and other analysis, so we want
to full test run to be used for this.

[1] https://docs.openstack.org/os-testr/latest/user/ostestr.html#test-selection

Change-Id: I890505d65ca6043ddbdcc5895f2620391b505756
(cherry picked from commit ce8ffc5)
  • Loading branch information
mtreinish authored and mriedem committed Oct 6, 2017
1 parent bac80e3 commit bb7628f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tox.ini
Expand Up @@ -26,14 +26,14 @@ 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 ostestr 'nova.tests.unit.test_profiler'

[testenv:py35]
commands =
{[testenv]commands}
env TEST_OSPROFILER=1 ostestr --regex 'nova.tests.unit.test_profiler'
bash tools/pretty_tox3.sh '{posargs}'
env TEST_OSPROFILER=1 ostestr 'nova.tests.unit.test_profiler'

[testenv:pep8]
basepython = python2.7
Expand Down

0 comments on commit bb7628f

Please sign in to comment.