зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1546100
- [mochitest] Use kwargs from moztest.resolve in mach mochitest, r=jmaher
These days 'moztest.resolve' is becoming the defacto place to define test harness related metadata. Currently |mach test| uses it to find kwargs that need to get set for mochitest commands, but |mach mochitest| does not. Instead, it grabs this metadata from 'mochitest_options.py'. This patch makes the kwargs used consistent between both |mach test| and |mach mochitest|. Differential Revision: https://phabricator.services.mozilla.com/D28537 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
889d5aa9e6
Коммит
b3e208c4af
|
@ -105,12 +105,8 @@ class MochitestRunner(MozbuildObject):
|
|||
tests = list(resolver.resolve_tests(paths=test_paths, cwd=cwd))
|
||||
return tests
|
||||
|
||||
def run_desktop_test(self, context, tests=None, suite=None, **kwargs):
|
||||
"""Runs a mochitest.
|
||||
|
||||
suite is the type of mochitest to run. It can be one of ('plain',
|
||||
'chrome', 'browser', 'a11y').
|
||||
"""
|
||||
def run_desktop_test(self, context, tests=None, **kwargs):
|
||||
"""Runs a mochitest."""
|
||||
# runtests.py is ambiguous, so we load the file/module manually.
|
||||
if 'mochitest' not in sys.modules:
|
||||
import imp
|
||||
|
@ -144,7 +140,7 @@ class MochitestRunner(MozbuildObject):
|
|||
# refresh the page to pick up modifications. Therefore leave the browser
|
||||
# open if only running a single mochitest-plain test. This behaviour can
|
||||
# be overridden by passing in --keep-open=false.
|
||||
if len(tests) == 1 and options.keep_open is None and suite == 'plain':
|
||||
if len(tests) == 1 and options.keep_open is None and options.flavor == 'plain':
|
||||
options.keep_open = True
|
||||
|
||||
# We need this to enable colorization of output.
|
||||
|
@ -153,7 +149,7 @@ class MochitestRunner(MozbuildObject):
|
|||
self.log_manager.disable_unstructured()
|
||||
return result
|
||||
|
||||
def run_android_test(self, context, tests, suite=None, **kwargs):
|
||||
def run_android_test(self, context, tests, **kwargs):
|
||||
host_ret = verify_host_bin()
|
||||
if host_ret != 0:
|
||||
return host_ret
|
||||
|
@ -193,7 +189,7 @@ class MochitestRunner(MozbuildObject):
|
|||
options = Namespace(**kwargs)
|
||||
return runjunit.run_test_harness(parser, options)
|
||||
|
||||
def run_robocop_test(self, context, tests, suite=None, **kwargs):
|
||||
def run_robocop_test(self, context, tests, **kwargs):
|
||||
host_ret = verify_host_bin()
|
||||
if host_ret != 0:
|
||||
return host_ret
|
||||
|
@ -332,6 +328,7 @@ class MachCommands(MachCommandBase):
|
|||
from mochitest_options import ALL_FLAVORS
|
||||
from mozlog.commandline import setup_logging
|
||||
from mozlog.handlers import StreamHandler
|
||||
from moztest.resolve import get_suite_definition
|
||||
|
||||
buildapp = None
|
||||
for app in SUPPORTED_APPS:
|
||||
|
@ -465,16 +462,16 @@ class MachCommands(MachCommandBase):
|
|||
|
||||
overall = None
|
||||
for (flavor, subsuite), tests in sorted(suites.items()):
|
||||
fobj = ALL_FLAVORS[flavor]
|
||||
_, suite = get_suite_definition(flavor, subsuite)
|
||||
if 'test_paths' in suite['kwargs']:
|
||||
del suite['kwargs']['test_paths']
|
||||
|
||||
harness_args = kwargs.copy()
|
||||
harness_args['subsuite'] = subsuite
|
||||
harness_args.update(fobj.get('extra_args', {}))
|
||||
harness_args.update(suite['kwargs'])
|
||||
|
||||
result = run_mochitest(
|
||||
self._mach_context,
|
||||
tests=tests,
|
||||
suite=fobj['suite'],
|
||||
**harness_args)
|
||||
|
||||
if result:
|
||||
|
|
|
@ -644,6 +644,11 @@ class MochitestArguments(ArgumentContainer):
|
|||
if options.flavor is None:
|
||||
options.flavor = 'plain'
|
||||
|
||||
for value in ALL_FLAVORS.values():
|
||||
if options.flavor in value['aliases']:
|
||||
options.flavor = value['suite']
|
||||
break
|
||||
|
||||
if options.gmp_path is None and options.app and build_obj:
|
||||
# Need to fix the location of gmp_fake which might not be shipped in the binary
|
||||
gmp_modules = (
|
||||
|
|
Загрузка…
Ссылка в новой задаче