Skip to content

Commit

Permalink
Merge "Fix "regex" switch for verify"
Browse files Browse the repository at this point in the history
  • Loading branch information
Jenkins authored and openstack-gerrit committed Jan 15, 2015
2 parents 637b41c + 43fe148 commit be56e1a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
9 changes: 6 additions & 3 deletions rally/cmd/commands/verify.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class VerifyCommands(object):
@cliutils.args("--no-use", action="store_false", dest="do_use",
help="Don't set new task as default for future operations")
@envutils.with_default_deployment
def start(self, set_name="smoke", deployment=None, regex=None,
def start(self, set_name="", deployment=None, regex=None,
tempest_config=None, do_use=False):
"""Start set of tests.
Expand All @@ -68,9 +68,12 @@ def start(self, set_name="smoke", deployment=None, regex=None,
:param tempest_config: User specified Tempest config file location
"""

if regex:
if regex and set_name:
raise exceptions.InvalidArgumentsException("set_name and regex "
"are not compatible")
if not (regex or set_name):
set_name = "full"
if set_name not in consts.TEMPEST_TEST_SETS:
if set_name and set_name not in consts.TEMPEST_TEST_SETS:
print("Sorry, but there are no desired tempest test set. Please "
"choose from: %s" % ", ".join(consts.TEMPEST_TEST_SETS))
return (1)
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/cmd/commands/test_verify.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def test_start(self, mock_verify, mock_clients):
self.flavor1, self.flavor2]

self.verify.start(deployment=deployment_id)
default_set_name = "smoke"
default_set_name = "full"
default_regex = None

mock_verify.assert_called_once_with(deployment_id,
Expand All @@ -73,7 +73,7 @@ def test_start_with_user_specified_tempest_config(self, mock_verify,
tempest_config = tempfile.NamedTemporaryFile()
self.verify.start(deployment=deployment_id,
tempest_config=tempest_config.name)
default_set_name = "smoke"
default_set_name = "full"
default_regex = None

mock_verify.assert_called_once_with(deployment_id,
Expand Down

0 comments on commit be56e1a

Please sign in to comment.