From 91caceed9c7a311253d5e593bf6053b94e8eb693 Mon Sep 17 00:00:00 2001 From: Matthew Treinish Date: Thu, 1 Aug 2013 17:30:17 -0400 Subject: 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 --- pbr/testr_command.py | 9 +++++++-- 1 file 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) -- cgit v1.2.1