예제 #1
0
 def __init__(self, fetch_config, options):
     self.fetch_config = fetch_config
     self.options = options
     self._test_runner = None
     self._bisector = None
     self._build_download_manager = None
     self._download_dir = options.persist
     self._rm_download_dir = False
     if not options.persist:
         self._download_dir = safe_mkdtemp()
         self._rm_download_dir = True
     launcher_class = APP_REGISTRY.get(fetch_config.app_name)
     launcher_class.check_is_runnable()
     # init global profile if required
     self._global_profile = None
     if options.profile_persistence in ("clone-first", "reuse"):
         self._global_profile = launcher_class.create_profile(
             profile=options.profile,
             addons=options.addons,
             preferences=options.preferences,
             clone=options.profile_persistence == "clone-first",
         )
         options.cmdargs = options.cmdargs + ["--allow-downgrade"]
     elif options.profile:
         options.cmdargs = options.cmdargs + ["--allow-downgrade"]
예제 #2
0
 def __init__(self, fetch_config, options):
     self.fetch_config = fetch_config
     self.options = options
     self._test_runner = None
     self._bisector = None
     self._build_download_manager = None
     self._download_dir = options.persist
     self._rm_download_dir = False
     if not options.persist:
         self._download_dir = safe_mkdtemp()
         self._rm_download_dir = True
     launcher_class = APP_REGISTRY.get(fetch_config.app_name)
     launcher_class.check_is_runnable()
     # init global profile if required
     self._global_profile = None
     if options.profile_persistence in ('clone-first', 'reuse'):
         self._global_profile = launcher_class.create_profile(
             profile=options.profile,
             addons=options.addons,
             preferences=options.preferences,
             clone=options.profile_persistence == 'clone-first'
         )
         options.cmdargs = options.cmdargs + ['--allow-downgrade']
     elif options.profile:
         options.cmdargs = options.cmdargs + ['--allow-downgrade']
예제 #3
0
 def validatePage(self):
     app_name = self.fetch_config.app_name
     launcher_class = LAUNCHER_REGISTRY.get(app_name)
     try:
         launcher_class.check_is_runnable()
         return True
     except LauncherNotRunnable, exc:
         QMessageBox.critical(self, "%s is not runnable" % app_name, str(exc))
         return False
예제 #4
0
def cli(argv=None):
    """
    main entry point of mozregression command line.
    """
    options = parse_args(argv)
    logger = commandline.setup_logging("mozregression", options,
                                       {"mach": sys.stdout})
    check_mozregression_version(logger)

    if options.list_releases:
        print(formatted_valid_release_dates())
        sys.exit()

    cache_session = limitedfilecache.get_cache(
        options.http_cache_dir,
        limitedfilecache.ONE_GIGABYTE,
        logger=get_default_logger('Limited File Cache'))
    set_http_cache_session(cache_session,
                           get_defaults={"timeout": options.http_timeout})

    fetch_config = create_config(options.app, mozinfo.os, options.bits)

    if options.command is None:
        launcher_kwargs = dict(
            addons=options.addons,
            profile=options.profile,
            cmdargs=options.cmdargs,
            preferences=preference(options.prefs_files, options.prefs),
        )
        test_runner = ManualTestRunner(launcher_kwargs=launcher_kwargs)
    else:
        test_runner = CommandTestRunner(options.command)

    runner = ResumeInfoBisectRunner(fetch_config, test_runner, options)

    if fetch_config.is_inbound():
        # this can be useful for both inbound and nightly, because we
        # can go to inbound from nightly.
        fetch_config.set_inbound_branch(options.inbound_branch)

    # bisect inbound if last good revision or first bad revision are set
    if options.first_bad_revision or options.last_good_revision:
        bisect = bisect_inbound
    else:
        bisect = bisect_nightlies

    try:
        launcher_class = APP_REGISTRY.get(fetch_config.app_name)
        launcher_class.check_is_runnable()

        sys.exit(bisect(runner, logger))
    except KeyboardInterrupt:
        sys.exit("\nInterrupted.")
    except UnavailableRelease as exc:
        sys.exit("%s\n%s" % (exc, formatted_valid_release_dates()))
    except (MozRegressionError, RequestException) as exc:
        sys.exit(str(exc))
예제 #5
0
def cli(argv=None):
    """
    main entry point of mozregression command line.
    """
    options = parse_args(argv)
    logger = commandline.setup_logging("mozregression",
                                       options,
                                       {"mach": sys.stdout})
    check_mozregression_version(logger)

    if options.list_releases:
        print(formatted_valid_release_dates())
        sys.exit()

    cache_session = limitedfilecache.get_cache(
        options.http_cache_dir, limitedfilecache.ONE_GIGABYTE,
        logger=get_default_logger('Limited File Cache'))
    set_http_cache_session(cache_session,
                           get_defaults={"timeout": options.http_timeout})

    fetch_config = create_config(options.app, mozinfo.os, options.bits)

    if options.command is None:
        launcher_kwargs = dict(
            addons=options.addons,
            profile=options.profile,
            cmdargs=options.cmdargs,
            preferences=preference(options.prefs_files, options.prefs),
        )
        test_runner = ManualTestRunner(launcher_kwargs=launcher_kwargs)
    else:
        test_runner = CommandTestRunner(options.command)

    runner = ResumeInfoBisectRunner(fetch_config, test_runner, options)

    if fetch_config.is_inbound():
        # this can be useful for both inbound and nightly, because we
        # can go to inbound from nightly.
        fetch_config.set_inbound_branch(options.inbound_branch)

    # bisect inbound if last good revision or first bad revision are set
    if options.first_bad_revision or options.last_good_revision:
        bisect = bisect_inbound
    else:
        bisect = bisect_nightlies

    try:
        launcher_class = APP_REGISTRY.get(fetch_config.app_name)
        launcher_class.check_is_runnable()

        sys.exit(bisect(runner, logger))
    except KeyboardInterrupt:
        sys.exit("\nInterrupted.")
    except UnavailableRelease as exc:
        sys.exit("%s\n%s" % (exc, formatted_valid_release_dates()))
    except (MozRegressionError, RequestException) as exc:
        sys.exit(str(exc))
예제 #6
0
 def validatePage(self):
     app_name = self.fetch_config.app_name
     launcher_class = LAUNCHER_REGISTRY.get(app_name)
     try:
         launcher_class.check_is_runnable()
         return True
     except LauncherNotRunnable as exc:
         QMessageBox.critical(self, "%s is not runnable" % app_name, str(exc))
         return False
예제 #7
0
    def options(self):
        options = {}
        for page_id in self.pageIds():
            self.page(page_id).set_options(options)

        fetch_config = self.page(self.pageIds()[0]).fetch_config
        fetch_config.set_repo(options['repository'])
        fetch_config.set_build_type(options['build_type'])

        # create a profile if required
        launcher_class = LAUNCHER_REGISTRY.get(fetch_config.app_name)
        if options['profile_persistence'] in ('clone-first', 'reuse'):
            options['profile'] = launcher_class.create_profile(
                profile=options['profile'],
                addons=options['addons'],
                preferences=options['preferences'],
                clone=options['profile_persistence'] == 'clone-first')

        return fetch_config, options
예제 #8
0
    def options(self):
        options = {}
        for page_id in self.pageIds():
            self.page(page_id).set_options(options)

        fetch_config = self.page(self.pageIds()[0]).fetch_config
        fetch_config.set_repo(options['repository'])
        fetch_config.set_build_type(options['build_type'])

        # create a profile if required
        launcher_class = LAUNCHER_REGISTRY.get(fetch_config.app_name)
        if options['profile_persistence'] in ('clone-first', 'reuse'):
            options['profile'] = launcher_class.create_profile(
                profile=options['profile'],
                addons=options['addons'],
                preferences=options['preferences'],
                clone=options['profile_persistence'] == 'clone-first')

        return fetch_config, options
예제 #9
0
    def options(self):
        options = {}
        for page_id in self.pageIds():
            self.page(page_id).set_options(options)

        fetch_config = self.page(self.pageIds()[0]).fetch_config
        fetch_config.set_repo(options["repository"])
        fetch_config.set_build_type(options["build_type"])

        # create a profile if required
        launcher_class = LAUNCHER_REGISTRY.get(fetch_config.app_name)
        if options["profile_persistence"] in ("clone-first", "reuse"):
            options["profile"] = launcher_class.create_profile(
                profile=options["profile"],
                addons=options["addons"],
                preferences=options["preferences"],
                clone=options["profile_persistence"] == "clone-first",
            )

        return fetch_config, options
예제 #10
0
 def __init__(self, fetch_config, options):
     self.fetch_config = fetch_config
     self.options = options
     self._test_runner = None
     self._bisector = None
     self._build_download_manager = None
     self._download_dir = options.persist
     self._rm_download_dir = False
     if not options.persist:
         self._download_dir = tempfile.mkdtemp()
         self._rm_download_dir = True
     launcher_class = APP_REGISTRY.get(fetch_config.app_name)
     launcher_class.check_is_runnable()
     # init global profile if required
     self._global_profile = None
     if options.profile_persistence in ('clone-first', 'reuse'):
         self._global_profile = launcher_class.create_profile(
             profile=options.profile,
             addons=options.addons,
             preferences=options.preferences,
             clone=options.profile_persistence == 'clone-first')
예제 #11
0
 def __init__(self, fetch_config, options):
     self.fetch_config = fetch_config
     self.options = options
     self._test_runner = None
     self._bisector = None
     self._build_download_manager = None
     self._logger = get_default_logger('main')
     self._download_dir = options.persist
     self._rm_download_dir = False
     if options.persist is None:
         self._download_dir = tempfile.mkdtemp()
         self._rm_download_dir = True
     launcher_class = APP_REGISTRY.get(fetch_config.app_name)
     launcher_class.check_is_runnable()
     # init global profile if required
     self._global_profile = None
     if options.profile_persistence in ('clone-first', 'reuse'):
         self._global_profile = launcher_class.create_profile(
             profile=options.profile,
             addons=options.addons,
             preferences=options.preferences,
             clone=options.profile_persistence == 'clone-first'
         )