author | Phil Ringnalda <philringnalda@gmail.com> |
Wed, 21 Dec 2016 20:19:24 -0800 | |
changeset 374137 | 7dd902e1e365fffbce9aae0873f480947874e7a2 |
parent 374136 | a4e7ea69171084484070dde3c45aaaff43b5e065 |
child 374138 | 3ace94607160346311e9c61c035961373a5d1e45 |
push id | 1419 |
push user | jlund@mozilla.com |
push date | Mon, 10 Apr 2017 20:44:07 +0000 |
treeherder | mozilla-release@5e6801b73ef6 [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
bugs | 1312739 |
milestone | 53.0a1 |
backs out | 1f3f88337227881a214cec65a9e283b78e3db05e ecb1d15e8075dc985d4be41447f3ae573bca2401 b2adce3404212ac0b7a8320023259138ccd9ae5f |
first release with | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
last release without | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
deleted file mode 100644 --- a/testing/mochitest/__init__.py +++ /dev/null @@ -1,3 +0,0 @@ -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/.
--- a/testing/mochitest/mach_commands.py +++ b/testing/mochitest/mach_commands.py @@ -1,16 +1,17 @@ # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. from __future__ import absolute_import, unicode_literals from argparse import Namespace from collections import defaultdict +from itertools import chain import logging import os import sys import warnings from mozbuild.base import ( MachCommandBase, MachCommandConditions as conditions, @@ -70,17 +71,71 @@ Please check spelling and make sure the NOW_RUNNING = ''' ###### ### Now running mochitest-{}. ###### ''' +# Maps test flavors to data needed to run them +ALL_FLAVORS = { + 'mochitest': { + 'suite': 'plain', + 'aliases': ('plain', 'mochitest'), + 'enabled_apps': ('firefox', 'android'), + 'extra_args': { + 'flavor': 'plain', + } + }, + 'chrome': { + 'suite': 'chrome', + 'aliases': ('chrome', 'mochitest-chrome'), + 'enabled_apps': ('firefox', 'android'), + 'extra_args': { + 'flavor': 'chrome', + } + }, + 'browser-chrome': { + 'suite': 'browser', + 'aliases': ('browser', 'browser-chrome', 'mochitest-browser-chrome', 'bc'), + 'enabled_apps': ('firefox',), + 'extra_args': { + 'flavor': 'browser', + } + }, + 'jetpack-package': { + 'suite': 'jetpack-package', + 'aliases': ('jetpack-package', 'mochitest-jetpack-package', 'jpp'), + 'enabled_apps': ('firefox',), + 'extra_args': { + 'flavor': 'jetpack-package', + } + }, + 'jetpack-addon': { + 'suite': 'jetpack-addon', + 'aliases': ('jetpack-addon', 'mochitest-jetpack-addon', 'jpa'), + 'enabled_apps': ('firefox',), + 'extra_args': { + 'flavor': 'jetpack-addon', + } + }, + 'a11y': { + 'suite': 'a11y', + 'aliases': ('a11y', 'mochitest-a11y', 'accessibility'), + 'enabled_apps': ('firefox',), + 'extra_args': { + 'flavor': 'a11y', + } + }, +} + SUPPORTED_APPS = ['firefox', 'android'] +SUPPORTED_FLAVORS = list(chain.from_iterable([f['aliases'] for f in ALL_FLAVORS.values()])) +CANONICAL_FLAVORS = sorted([f['aliases'][0] for f in ALL_FLAVORS.values()]) parser = None class MochitestRunner(MozbuildObject): """Easily run mochitests. @@ -271,19 +326,21 @@ def verify_host_bin(): @CommandProvider class MachCommands(MachCommandBase): @Command('mochitest', category='testing', conditions=[is_buildapp_in(*SUPPORTED_APPS)], description='Run any flavor of mochitest (integration test).', parser=setup_argument_parser) + @CommandArgument('-f', '--flavor', + metavar='{{{}}}'.format(', '.join(CANONICAL_FLAVORS)), + choices=SUPPORTED_FLAVORS, + help='Only run tests of this flavor.') def run_mochitest_general(self, flavor=None, test_objects=None, resolve_tests=True, **kwargs): - from mochitest.mochitest_options import ALL_FLAVORS - buildapp = None for app in SUPPORTED_APPS: if is_buildapp_in(app)(self): buildapp = app break flavors = None if flavor:
--- a/testing/mochitest/mach_test_package_commands.py +++ b/testing/mochitest/mach_test_package_commands.py @@ -13,33 +13,22 @@ from mach.decorators import ( Command, ) here = os.path.abspath(os.path.dirname(__file__)) parser = None def run_mochitest(context, **kwargs): - from mochitest_options import ALL_FLAVORS - flavor = kwargs.get('flavor') or 'mochitest' - if flavor not in ALL_FLAVORS: - for fname, fobj in ALL_FLAVORS.iteritems(): - if flavor in fobj['aliases']: - flavor = fname - break - fobj = ALL_FLAVORS[flavor] - kwargs.update(fobj.get('extra_args', {})) - args = Namespace(**kwargs) args.e10s = context.mozharness_config.get('e10s', args.e10s) args.certPath = context.certs_dir if args.test_paths: - install_subdir = fobj.get('install_subdir', fobj['suite']) - test_root = os.path.join(context.package_root, 'mochitest', install_subdir) + test_root = os.path.join(context.package_root, 'mochitest', 'tests') normalize = partial(context.normalize_test_path, test_root) args.test_paths = map(normalize, args.test_paths) import mozinfo if mozinfo.info.get('buildapp') == 'mobile/android': return run_mochitest_android(context, args) return run_mochitest_desktop(context, args)
--- a/testing/mochitest/mochitest_options.py +++ b/testing/mochitest/mochitest_options.py @@ -1,16 +1,15 @@ # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. from abc import ABCMeta, abstractmethod, abstractproperty from argparse import ArgumentParser, SUPPRESS from distutils.util import strtobool -from itertools import chain from urlparse import urlparse import json import os import tempfile from mozdevice import DroidADB, DroidSUT from mozprofile import DEFAULT_PORTS import mozinfo @@ -26,72 +25,16 @@ try: MachCommandConditions as conditions, ) build_obj = MozbuildObject.from_environment(cwd=here) except ImportError: build_obj = None conditions = None -# Maps test flavors to data needed to run them -ALL_FLAVORS = { - 'mochitest': { - 'suite': 'plain', - 'aliases': ('plain', 'mochitest'), - 'enabled_apps': ('firefox', 'android'), - 'extra_args': { - 'flavor': 'plain', - }, - 'install_subdir': 'tests', - }, - 'chrome': { - 'suite': 'chrome', - 'aliases': ('chrome', 'mochitest-chrome'), - 'enabled_apps': ('firefox', 'android'), - 'extra_args': { - 'flavor': 'chrome', - } - }, - 'browser-chrome': { - 'suite': 'browser', - 'aliases': ('browser', 'browser-chrome', 'mochitest-browser-chrome', 'bc'), - 'enabled_apps': ('firefox',), - 'extra_args': { - 'flavor': 'browser', - } - }, - 'jetpack-package': { - 'suite': 'jetpack-package', - 'aliases': ('jetpack-package', 'mochitest-jetpack-package', 'jpp'), - 'enabled_apps': ('firefox',), - 'extra_args': { - 'flavor': 'jetpack-package', - } - }, - 'jetpack-addon': { - 'suite': 'jetpack-addon', - 'aliases': ('jetpack-addon', 'mochitest-jetpack-addon', 'jpa'), - 'enabled_apps': ('firefox',), - 'extra_args': { - 'flavor': 'jetpack-addon', - } - }, - 'a11y': { - 'suite': 'a11y', - 'aliases': ('a11y', 'mochitest-a11y', 'accessibility'), - 'enabled_apps': ('firefox',), - 'extra_args': { - 'flavor': 'a11y', - } - }, -} -SUPPORTED_FLAVORS = list(chain.from_iterable([f['aliases'] for f in ALL_FLAVORS.values()])) -CANONICAL_FLAVORS = sorted([f['aliases'][0] for f in ALL_FLAVORS.values()]) - - def get_default_valgrind_suppression_files(): # We are trying to locate files in the source tree. So if we # don't know where the source tree is, we must give up. # # When this is being run by |mach mochitest --valgrind ...|, it is # expected that |build_obj| is not None, and so the logic below will # select the correct suppression files. # @@ -137,31 +80,33 @@ class ArgumentContainer(): def get_full_path(self, path, cwd): """Get an absolute path relative to cwd.""" return os.path.normpath(os.path.join(cwd, os.path.expanduser(path))) class MochitestArguments(ArgumentContainer): """General mochitest arguments.""" + + FLAVORS = ('a11y', 'browser', 'chrome', 'jetpack-addon', 'jetpack-package', 'plain') LOG_LEVELS = ("DEBUG", "INFO", "WARNING", "ERROR", "FATAL") args = [ [["test_paths"], {"nargs": "*", "metavar": "TEST", "default": [], "help": "Test to run. Can be a single test file or a directory of tests " "(to run recursively). If omitted, the entire suite is run.", }], [["-f", "--flavor"], - {"choices": SUPPORTED_FLAVORS, - "metavar": "{{{}}}".format(', '.join(CANONICAL_FLAVORS)), - "default": None, - "help": "Only run tests of this flavor.", + {"default": "plain", + "choices": FLAVORS, + "help": "Mochitest flavor to run, one of {}. Defaults to 'plain'.".format(FLAVORS), + "suppress": build_obj is not None, }], [["--keep-open"], {"nargs": "?", "type": strtobool, "const": "true", "default": None, "help": "Always keep the browser open after tests complete. Or always close the " "browser with --keep-open=false", @@ -633,19 +578,16 @@ class MochitestArguments(ArgumentContain options.app = build_obj.get_binary_path(where='staged-package') options.app = self.get_full_path(options.app, parser.oldcwd) if not os.path.exists(options.app): parser.error("Error: Path {} doesn't exist. Are you executing " "$objdir/_tests/testing/mochitest/runtests.py?".format( options.app)) - if options.flavor is None: - options.flavor == 'plain' - 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 = ( ('gmp-fake', '1.0'), ('gmp-clearkey', '0.1'), ('gmp-fakeopenh264', '1.0') ) options.gmp_path = os.pathsep.join(
--- a/testing/tools/mach_test_package_bootstrap.py +++ b/testing/tools/mach_test_package_bootstrap.py @@ -7,18 +7,18 @@ from __future__ import print_function, u import json import os import platform import sys import types SEARCH_PATHS = [ - 'marionette/harness', - 'marionette/harness/marionette_harness/runner/mixins/browsermob-proxy-py', + 'marionette', + 'marionette/marionette/runner/mixins/browsermob-proxy-py', 'marionette/client', 'mochitest', 'mozbase/manifestparser', 'mozbase/mozcrash', 'mozbase/mozdebug', 'mozbase/mozdevice', 'mozbase/mozfile', 'mozbase/mozhttpd',