diff options
author | Matthew Treinish <treinish@linux.vnet.ibm.com> | 2013-08-01 17:30:17 -0400 |
---|---|---|
committer | Matthew Treinish <treinish@linux.vnet.ibm.com> | 2013-08-06 15:50:43 -0400 |
commit | 91caceed9c7a311253d5e593bf6053b94e8eb693 (patch) | |
tree | 393bd3b55e14a143b9d69ddd6d49163450a1df11 | |
parent | 600aa2a25052380e2010f8001c3185ad35d8a67d (diff) | |
download | pbr-91caceed9c7a311253d5e593bf6053b94e8eb693.tar.gz |
Add option to run testr serially
This commit adds a new serial option to testr_command.py that when
set will run testr serially instead of running testr with the
'--parallel' flag.
Change-Id: Id49b105dc921e9acdef1a94d933719ad3a772c81
-rw-r--r-- | pbr/testr_command.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/pbr/testr_command.py b/pbr/testr_command.py index 23699dc..cf2a075 100644 --- a/pbr/testr_command.py +++ b/pbr/testr_command.py @@ -56,9 +56,10 @@ class Testr(cmd.Command): ('testr-args=', 't', "Run 'testr' with these args"), ('omit=', 'o', 'Files to omit from coverage calculations'), ('slowest', None, "Show slowest test times after tests complete."), + ('no-parallel', None, "Run testr serially"), ] - boolean_options = ['coverage', 'slowest'] + boolean_options = ['coverage', 'slowest', 'no_parallel'] def _run_testr(self, *args): return commands.run_argv([sys.argv[0]] + list(args), @@ -69,6 +70,7 @@ class Testr(cmd.Command): self.coverage = None self.omit = "" self.slowest = None + self.no_parallel = None def finalize_options(self): if self.testr_args is None: @@ -85,7 +87,10 @@ class Testr(cmd.Command): if self.coverage: self._coverage_before() - testr_ret = self._run_testr("run", "--parallel", *self.testr_args) + if not self.no_parallel: + testr_ret = self._run_testr("run", "--parallel", *self.testr_args) + else: + testr_ret = self._run_testr("run", *self.testr_args) if testr_ret: raise distutils.errors.DistutilsError( "testr failed (%d)" % testr_ret) |