Esempio n. 1
0
 def run_mochitest_chrome(self, test_paths, **kwargs):
     if conditions.is_firefox(self):
         return self.run_mochitest(test_paths, 'chrome', **kwargs)
     elif conditions.is_b2g(self) and conditions.is_emulator(self):
         return self.run_mochitest_remote(test_paths, chrome=True, **kwargs)
     elif conditions.is_android(self):
         return self.run_mochitest_android(test_paths, chrome=True, **kwargs)
Esempio n. 2
0
 def telemetry_test(self, tests, **kwargs):
     if "test_objects" in kwargs:
         tests = []
         for obj in kwargs["test_objects"]:
             tests.append(obj["file_relpath"])
         del kwargs["test_objects"]
     if not kwargs.get("binary") and conditions.is_firefox(self):
         try:
             kwargs["binary"] = self.get_binary_path("app")
         except BinaryNotFoundException as e:
             self.log(
                 logging.ERROR,
                 "telemetry-tests-client",
                 {"error": str(e)},
                 "ERROR: {error}",
             )
             self.log(
                 logging.INFO, "telemetry-tests-client", {"help": e.help()}, "{help}"
             )
             return 1
     if not kwargs.get("server_root"):
         kwargs[
             "server_root"
         ] = "toolkit/components/telemetry/tests/marionette/harness/www"
     return run_telemetry(tests, topsrcdir=self.topsrcdir, **kwargs)
Esempio n. 3
0
    def marionette_test(self, tests, **kwargs):
        if "test_objects" in kwargs:
            tests = []
            for obj in kwargs["test_objects"]:
                tests.append(obj["file_relpath"])
            del kwargs["test_objects"]

        if not tests:
            if conditions.is_thunderbird(self):
                tests = [
                    os.path.join(self.topsrcdir,
                                 "comm/testing/marionette/unit-tests.ini")
                ]
            else:
                tests = [
                    os.path.join(
                        self.topsrcdir,
                        "testing/marionette/harness/marionette_harness/tests/unit-tests.ini"
                    )
                ]

        if not kwargs.get("binary") and \
                (conditions.is_firefox(self) or conditions.is_thunderbird(self)):
            kwargs["binary"] = self.get_binary_path("app")

        return run_marionette(tests, topsrcdir=self.topsrcdir, **kwargs)
Esempio n. 4
0
    def marionette_test(self, tests, **kwargs):
        if "test_objects" in kwargs:
            tests = []
            for obj in kwargs["test_objects"]:
                tests.append(obj["file_relpath"])
            del kwargs["test_objects"]

        if not tests:
            if conditions.is_thunderbird(self):
                tests = [os.path.join(self.topsrcdir,
                         "comm/testing/marionette/unit-tests.ini")]
            else:
                tests = [os.path.join(self.topsrcdir,
                         "testing/marionette/harness/marionette_harness/tests/unit-tests.ini")]

        if not kwargs.get("binary") and \
                (conditions.is_firefox(self) or conditions.is_thunderbird(self)):
            try:
                kwargs["binary"] = self.get_binary_path("app")
            except BinaryNotFoundException as e:
                self.log(logging.ERROR, 'marionette-test',
                         {'error': str(e)},
                         'ERROR: {error}')
                self.log(logging.INFO, 'marionette-test',
                         {'help': e.help()},
                         '{help}')
                return 1

        return run_marionette(tests, topsrcdir=self.topsrcdir, **kwargs)
Esempio n. 5
0
    def run_awsy_test(self, tests, **kwargs):
        """mach awsy-test runs the in-tree version of the Are We Slim Yet
        (AWSY) tests.

        awsy-test is implemented as a marionette test and marionette
        test arguments also apply although they are not necessary
        since reasonable defaults will be chosen.

        The AWSY specific arguments can be found in the Command
        Arguments for AWSY section below.

        awsy-test will automatically download the tp5n.zip talos
        pageset from tooltool and install it under
        topobjdir/_tests/awsy/html. You can specify your own page set
        by specifying --web-root and --page-manifest.

        The results of the test will be placed in the results
        directory specified by the --results argument.

        """
        kwargs['logger_name'] = 'Awsy Tests'
        if 'test_objects' in kwargs:
            tests = []
            for obj in kwargs['test_objects']:
                tests.append(obj['file_relpath'])
            del kwargs['test_objects']

        if not kwargs.get('binary') and conditions.is_firefox(self):
            kwargs['binary'] = self.get_binary_path('app')
        return self.run_awsy(tests, **kwargs)
Esempio n. 6
0
 def run_mochitest_chrome(self, test_paths, **kwargs):
     if conditions.is_firefox(self):
         return self.run_mochitest(test_paths, 'chrome', **kwargs)
     elif conditions.is_b2g(self) and conditions.is_emulator(self):
         return self.run_mochitest_remote(test_paths, chrome=True, **kwargs)
     elif conditions.is_android(self):
         return self.run_mochitest_android(test_paths, chrome=True, **kwargs)
Esempio n. 7
0
    def run_marionette_test(self, tests, **kwargs):
        if "test_objects" in kwargs:
            tests = []
            for obj in kwargs["test_objects"]:
                tests.append(obj["file_relpath"])
            del kwargs["test_objects"]

        if not kwargs.get("binary") and conditions.is_firefox(self):
            kwargs["binary"] = self.get_binary_path("app")
        return run_marionette(tests, topsrcdir=self.topsrcdir, **kwargs)
Esempio n. 8
0
    def run_marionette_test(self, tests, **kwargs):
        if 'test_objects' in kwargs:
            tests = []
            for obj in kwargs['test_objects']:
                tests.append(obj['file_relpath'])
            del kwargs['test_objects']

        if not kwargs.get('binary') and conditions.is_firefox(self):
            kwargs['binary'] = self.get_binary_path('app')
        return run_marionette(tests, topsrcdir=self.topsrcdir, **kwargs)
Esempio n. 9
0
    def marionette_test(self, tests, **kwargs):
        if "test_objects" in kwargs:
            tests = []
            for obj in kwargs["test_objects"]:
                tests.append(obj["file_relpath"])
            del kwargs["test_objects"]

        if not kwargs.get("binary") and conditions.is_firefox(self):
            kwargs["binary"] = self.get_binary_path("app")
        return run_marionette(tests, topsrcdir=self.topsrcdir, **kwargs)
Esempio n. 10
0
 def telemetry_test(self, tests, **kwargs):
     if "test_objects" in kwargs:
         tests = []
         for obj in kwargs["test_objects"]:
             tests.append(obj["file_relpath"])
         del kwargs["test_objects"]
     if not kwargs.get("binary") and conditions.is_firefox(self):
         kwargs["binary"] = self.get_binary_path("app")
     if not kwargs.get("server_root"):
         kwargs[
             "server_root"] = "toolkit/components/telemetry/tests/marionette/harness/www"
     return run_telemetry(tests, topsrcdir=self.topsrcdir, **kwargs)
Esempio n. 11
0
    def run_marionette_test(self, tests, **kwargs):
        if 'test_objects' in kwargs:
            tests = []
            for obj in kwargs['test_objects']:
                tests.append(obj['file_relpath'])
            del kwargs['test_objects']

        if conditions.is_firefox(self):
            bin_path = self.get_binary_path('app')
            if kwargs.get('binary') is not None:
                print "Warning: ignoring '--binary' option, using binary at " + bin_path
            kwargs['binary'] = bin_path
        return run_marionette(tests, topsrcdir=self.topsrcdir, **kwargs)
Esempio n. 12
0
    def run_marionette_test(self, tests, **kwargs):
        print >> sys.stderr, ("warning: ./mach marionette-test is deprecated; "
                              "please use ./mach marionette test")

        if "test_objects" in kwargs:
            tests = []
            for obj in kwargs["test_objects"]:
                tests.append(obj["file_relpath"])
            del kwargs["test_objects"]

        if not kwargs.get("binary") and conditions.is_firefox(self):
            kwargs["binary"] = self.get_binary_path("app")
        return run_marionette(tests, topsrcdir=self.topsrcdir, **kwargs)
Esempio n. 13
0
    def run_marionette_test(self, tests, **kwargs):
        if 'test_objects' in kwargs:
            tests = []
            for obj in kwargs['test_objects']:
                tests.append(obj['file_relpath'])
            del kwargs['test_objects']

        if conditions.is_firefox(self):
            bin_path = self.get_binary_path('app')
            if kwargs.get('binary') is not None:
                print "Warning: ignoring '--binary' option, using binary at " + bin_path
            kwargs['binary'] = bin_path
        return run_marionette(tests, topsrcdir=self.topsrcdir, **kwargs)
Esempio n. 14
0
    def run_awsy_test(self, tests, **kwargs):
        """mach awsy-test runs the in-tree version of the Are We Slim Yet
        (AWSY) tests.

        awsy-test is implemented as a marionette test and marionette
        test arguments also apply although they are not necessary
        since reasonable defaults will be chosen.

        The AWSY specific arguments can be found in the Command
        Arguments for AWSY section below.

        awsy-test will automatically download the tp5n.zip talos
        pageset from tooltool and install it under
        topobjdir/_tests/awsy/html. You can specify your own page set
        by specifying --web-root and --page-manifest.

        The results of the test will be placed in the results
        directory specified by the --results argument.

        On Windows, you may experience problems due to path length
        errors when extracting the tp5n.zip file containing the
        test pages or when attempting to write checkpoints to the
        results directory. In that case, you should specify both
        the --web-root and --results arguments pointing to a location
        with a short path. For example:

        --web-root=c:\\\\tmp\\\\html --results=c:\\\\tmp\\\\results

        Note that the double backslashes are required.
        """
        kwargs['logger_name'] = 'Awsy Tests'
        if 'test_objects' in kwargs:
            tests = []
            for obj in kwargs['test_objects']:
                tests.append(obj['file_relpath'])
            del kwargs['test_objects']

        if not kwargs.get('binary') and conditions.is_firefox(self):
            try:
                kwargs['binary'] = self.get_binary_path('app')
            except BinaryNotFoundException as e:
                self.log(logging.ERROR, 'awsy',
                         {'error': str(e)},
                         'ERROR: {error}')
                self.log(logging.INFO, 'awsy',
                         {'help': e.help()},
                         '{help}')
                return 1
        return self.run_awsy(tests, **kwargs)
Esempio n. 15
0
    def marionette_test(self, tests, **kwargs):
        if "test_objects" in kwargs:
            tests = []
            for obj in kwargs["test_objects"]:
                tests.append(obj["file_relpath"])
            del kwargs["test_objects"]

        # Force disable e10s because it is not supported in Fennec
        if kwargs.get("app") == "fennec":
            kwargs["e10s"] = False

        if not kwargs.get("binary") and conditions.is_firefox(self):
            kwargs["binary"] = self.get_binary_path("app")

        return run_marionette(tests, topsrcdir=self.topsrcdir, **kwargs)
Esempio n. 16
0
def marionette_test(command_context, tests, **kwargs):
    if "test_objects" in kwargs:
        tests = []
        for obj in kwargs["test_objects"]:
            tests.append(obj["file_relpath"])
        del kwargs["test_objects"]

    if not tests:
        if conditions.is_thunderbird(command_context):
            tests = [
                os.path.join(
                    command_context.topsrcdir,
                    "comm/testing/marionette/unit-tests.ini",
                )
            ]
        else:
            tests = [
                os.path.join(
                    command_context.topsrcdir,
                    "testing/marionette/harness/marionette_harness/tests/unit-tests.ini",
                )
            ]

    if not kwargs.get("binary") and (
        conditions.is_firefox(command_context)
        or conditions.is_thunderbird(command_context)
    ):
        try:
            kwargs["binary"] = command_context.get_binary_path("app")
        except BinaryNotFoundException as e:
            command_context.log(
                logging.ERROR,
                "marionette-test",
                {"error": str(e)},
                "ERROR: {error}",
            )
            command_context.log(
                logging.INFO, "marionette-test", {"help": e.help()}, "{help}"
            )
            return 1

    return run_marionette(tests, topsrcdir=command_context.topsrcdir, **kwargs)
Esempio n. 17
0
    def run_awsy_test(self, tests, **kwargs):
        """mach awsy-test runs the in-tree version of the Are We Slim Yet
        (AWSY) tests.

        awsy-test is implemented as a marionette test and marionette
        test arguments also apply although they are not necessary
        since reasonable defaults will be chosen.

        The AWSY specific arguments can be found in the Command
        Arguments for AWSY section below.

        awsy-test will automatically download the tp5n.zip talos
        pageset from tooltool and install it under
        topobjdir/_tests/awsy/html. You can specify your own page set
        by specifying --web-root and --page-manifest.

        The results of the test will be placed in the results
        directory specified by the --results argument.

        On Windows, you may experience problems due to path length
        errors when extracting the tp5n.zip file containing the
        test pages or when attempting to write checkpoints to the
        results directory. In that case, you should specify both
        the --web-root and --results arguments pointing to a location
        with a short path. For example:

        --web-root=c:\\\\tmp\\\\html --results=c:\\\\tmp\\\\results

        Note that the double backslashes are required.
        """
        kwargs['logger_name'] = 'Awsy Tests'
        if 'test_objects' in kwargs:
            tests = []
            for obj in kwargs['test_objects']:
                tests.append(obj['file_relpath'])
            del kwargs['test_objects']

        if not kwargs.get('binary') and conditions.is_firefox(self):
            kwargs['binary'] = self.get_binary_path('app')
        return self.run_awsy(tests, **kwargs)
Esempio n. 18
0
def is_platform_supported(cls):
    """Must have a Firefox, Android or B2G build."""
    return conditions.is_android(cls) or \
           conditions.is_b2g(cls) or \
           conditions.is_firefox(cls)
Esempio n. 19
0
def is_platform_supported(cls):
    """Must have a Firefox, Android or B2G build."""
    return conditions.is_android(cls) or \
           conditions.is_b2g(cls) or \
           conditions.is_firefox(cls)
Esempio n. 20
0
def is_firefox_or_android(cls):
    """Must have Firefox build or Android build."""
    return conditions.is_firefox(cls) or conditions.is_android(cls)
Esempio n. 21
0
def is_firefox_or_android(cls):
    """Must have Firefox build or Android build."""
    return conditions.is_firefox(cls) or conditions.is_android(cls)