Bug 1255064 - MarionetteHarness should internally use dicts for arguments; r=maja_zf a=test-only

MozReview-Commit-ID: 94muKM44wVq
This commit is contained in:
Rachel 2016-03-18 19:33:08 -07:00
parent 36992d510c
commit 0170e73a8f
3 changed files with 11 additions and 10 deletions

View File

@ -50,7 +50,7 @@ def run_external_media_test(tests, testtype=None, topsrcdir=None, **kwargs):
args,
{"mach": sys.stdout})
failed = mn_cli(MediaTestRunner, MediaTestArguments, FirefoxMediaHarness,
args=args)
args=vars(args))
if failed > 0:
return 1

View File

@ -53,23 +53,24 @@ class MarionetteHarness(object):
args.logger_name, args, logger_defaults or {"tbpl": sys.stdout})
args.logger = logger
return args
return vars(args)
def process_args(self):
if self.args.pydebugger:
MarionetteTestCase.pydebugger = __import__(self.args.pydebugger)
if self.args.get('pydebugger'):
MarionetteTestCase.pydebugger = __import__(self.args['pydebugger'])
def run(self):
try:
self.process_args()
args_dict = vars(self.args)
tests = args_dict.pop('tests')
runner = self._runner_class(**args_dict)
tests = self.args.pop('tests')
runner = self._runner_class(**self.args)
runner.run_tests(tests)
return runner.failed
except Exception:
self.args.logger.error('Failure during test execution.',
exc_info=True)
logger = self.args.get('logger')
if logger:
logger.error('Failure during test execution.',
exc_info=True)
raise

View File

@ -67,7 +67,7 @@ def run_marionette(tests, b2g_path=None, emulator=None, testtype=None,
args.logger = commandline.setup_logging("Marionette Unit Tests",
args,
{"mach": sys.stdout})
failed = MarionetteHarness(MarionetteTestRunner, args=args).run()
failed = MarionetteHarness(MarionetteTestRunner, args=vars(args)).run()
if failed > 0:
return 1
else: