diff --git a/README.rst b/README.rst index 8891ae2..9432886 100644 --- a/README.rst +++ b/README.rst @@ -95,6 +95,8 @@ Usage After the first ``--``, all other subsequent arguments will be passed to tempest run as is. This is mainly used for quick verification of the target test cases. (e.g. ``-- --regex tempest.api.identity.v2.test_token``) + g. If you have provisioned multiple user/project accounts you can run parallel + test execution by enabling the ``--parallel`` flag. Use ``refstack-client test --help`` for the full list of arguments. diff --git a/refstack_client/refstack_client.py b/refstack_client/refstack_client.py index 4fdf0b4..0ebfcc0 100755 --- a/refstack_client/refstack_client.py +++ b/refstack_client/refstack_client.py @@ -423,9 +423,11 @@ class RefstackClient: # Run the tempest run command, conf file specified at _prep_test method # Use virtual environment (wrapper script) - # telling it to run the tests serially (--serial). + # Run the tests serially if parallel not enabled (--serial). wrapper = os.path.join(self.tempest_dir, 'tools', 'with_venv.sh') - cmd = [wrapper, 'tempest', 'run', '--serial'] + cmd = [wrapper, 'tempest', 'run'] + if not self.args.parallel: + cmd.append('--serial') # If a test list was specified, have it take precedence. if self.args.test_list: self.logger.info("Normalizing test list...") @@ -744,6 +746,13 @@ def parse_cli_args(args=None): 'results to the default RefStack API server ' 'or the server specified by --url.') + parser_test.add_argument('-p', '--parallel', + action='store_true', + required=False, + help='Run the tests in parallel. Note this ' + 'requires multiple users/projects in ' + 'accounts.yaml.') + # This positional argument will allow arbitrary arguments to be passed in # with the usage of '--'. parser_test.add_argument('arbitrary_args',