Skip to content

Commit

Permalink
Bug 1222388: Correct ./mach marionette-test r=ato
Browse files Browse the repository at this point in the history
There have been a number of improvements to the marionette test runner
unfortunately we missed this regression.

--HG--
extra : commitid : KE4FPolRysN
extra : rebase_source : 546152a67a4fd96a1d3c63ba914839c316022eaf
  • Loading branch information
David Burns committed Nov 9, 2015
1 parent 4d6f05d commit 19232bc
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
9 changes: 4 additions & 5 deletions testing/marionette/client/marionette/runtests.py
Expand Up @@ -31,10 +31,11 @@ def __init__(self, **kwargs):
class MarionetteHarness(object):
def __init__(self,
runner_class=MarionetteTestRunner,
parser_class=MarionetteArguments):
parser_class=MarionetteArguments,
args=None):
self._runner_class = runner_class
self._parser_class = parser_class
self.args = self.parse_args()
self.args = args or self.parse_args()

def parse_args(self, logger_defaults=None):
parser = self._parser_class(
Expand Down Expand Up @@ -68,14 +69,12 @@ def run(self):
tests = args_dict.pop('tests')
runner = self._runner_class(**args_dict)
runner.run_tests(tests)
if runner.failed > 0:
sys.exit(10)
return runner
except Exception:
self.args.logger.error('Failure during test execution.',
exc_info=True)
sys.exit(1)


def cli(runner_class=MarionetteTestRunner, parser_class=MarionetteArguments):
MarionetteHarness(runner_class, parser_class).run()

Expand Down
11 changes: 6 additions & 5 deletions testing/marionette/mach_commands.py
Expand Up @@ -39,7 +39,7 @@ def run_marionette(tests, b2g_path=None, emulator=None, testtype=None,
from marionette.runtests import (
MarionetteTestRunner,
BaseMarionetteArguments,
startTestRunner
MarionetteHarness
)

parser = BaseMarionetteArguments()
Expand Down Expand Up @@ -68,11 +68,12 @@ def run_marionette(tests, b2g_path=None, emulator=None, testtype=None,
args,
{"mach": sys.stdout})

runner = startTestRunner(MarionetteTestRunner, args)
if runner.failed > 0:
return 1
results = MarionetteHarness(MarionetteTestRunner, args=args).run()

return 0
if results.failed > 0:
return 1
else:
return 0

@CommandProvider
class B2GCommands(MachCommandBase):
Expand Down

0 comments on commit 19232bc

Please sign in to comment.