def __init__(self, good, bad, platform, warning, warning_limit, warning_re, ignore_lines, required_test): init_logger() self.use_nightly = True try: self.good = parse_date(good) self.bad = parse_date(bad) except DateFormatError: # This hopefully a revision range. We can bypass nightly and # go directly to InboundHandler. That itself is a bit of a misnomer, # it will still bisect m-c builds, but by changeset range, not date # range. self.use_nightly = False self.good = good self.bad = bad self.ignore_lines = ignore_lines self.test_runner = WarningTestRunner(warning, platform, ignore_lines=ignore_lines, warning_re=warning_re, warning_limit=warning_limit, required_test=required_test) # Convert the platform to a mozregression friendly version. # Also avoid overwriting the os module by *not* using |os| for a # variable name. (_os, bits) = re.match(r'([a-zA-Z]+)-?([0-9]+)?', platform).groups() if not bits or bits not in (32, 64): bits = 32 # windows7-32 # windows7-32-vm # win32 # win64 if '64' in platform: bits = 64 if _os.startswith('win'): _os = 'win' print("_os = %s bits = %s" % (_os, bits)) # TODO(ER): We might be able to ditch this. self.fetch_config = create_config('firefox', _os, int(bits)) # Hardcode to m-c for now. self.fetch_config.set_repo('mozilla-central') self.fetch_config.set_build_type('debug') class FakeDownloadManager: def focus_download(self, foo): pass dm = FakeDownloadManager() self.bisector = Bisector(self.fetch_config, self.test_runner, dm, False, None)
def __init__(self, good, bad, platform, warning, warning_limit, warning_re, ignore_lines, required_test): init_logger() self.use_nightly = True try: self.good = parse_date(good) self.bad = parse_date(bad) except DateFormatError: # This hopefully a revision range. We can bypass nightly and # go directly to InboundHandler. That itself is a bit of a misnomer, # it will still bisect m-c builds, but by changeset range, not date # range. self.use_nightly = False self.good = good self.bad = bad self.ignore_lines = ignore_lines self.test_runner = WarningTestRunner( warning, platform, ignore_lines=ignore_lines, warning_re=warning_re, warning_limit=warning_limit, required_test=required_test) # Convert the platform to a mozregression friendly version. # Also avoid overwriting the os module by *not* using |os| for a # variable name. (_os, bits) = re.match(r'([a-zA-Z]+)-?([0-9]+)?', platform).groups() if not bits or bits not in (32, 64): bits = 32 # windows7-32 # windows7-32-vm # win32 # win64 if '64' in platform: bits = 64 if _os.startswith('win'): _os = 'win' print "_os = %s bits = %s" % (_os, bits) # TODO(ER): We might be able to ditch this. self.fetch_config = create_config('firefox', _os, int(bits)) # Hardcode to m-c for now. self.fetch_config.set_repo('mozilla-central') self.fetch_config.set_build_type('debug') class FakeDownloadManager: def focus_download(self, foo): pass dm = FakeDownloadManager() self.bisector = Bisector(self.fetch_config, self.test_runner, dm, False, None)
def __init__(self, options, config): self.options = options self.logger = init_logger(debug=options.debug) # allow to filter process output based on the user option if options.process_output is None: # process_output not user defined log_process_output = options.build_type != "" else: log_process_output = options.process_output == "stdout" get_default_logger("process").component_filter = ( lambda data: data if log_process_output else None ) # filter some mozversion log lines re_ignore_mozversion_line = re.compile( r"^(platform_.+|application_vendor|application_remotingname" r"|application_id|application_display_name): .+" ) get_default_logger("mozversion").component_filter = lambda data: ( None if re_ignore_mozversion_line.match(data["message"]) else data ) self.enable_telemetry = config["enable-telemetry"] not in ("no", "false", 0) self.action = None self.fetch_config = None
def __init__(self, options): self.options = options self.logger = init_logger(debug=options.debug) # allow to filter process output based on the user option if options.process_output is None: # process_output not user defined log_process_output = options.build_type != 'opt' else: log_process_output = options.process_output == 'stdout' get_default_logger("process").component_filter = \ lambda data: data if log_process_output else None # filter some mozversion log lines re_ignore_mozversion_line = re.compile( r"^(platform_.+|application_vendor|application_remotingname" r"|application_id|application_display_name): .+") get_default_logger("mozversion").component_filter = lambda data: ( None if re_ignore_mozversion_line.match(data['message']) else data) self.action = None self.fetch_config = None
def __init__(self, options): self.options = options self.logger = init_logger(debug=options.debug) # allow to filter process output based on the user option if options.process_output is None: # process_output not user defined log_process_output = options.build_type != 'opt' else: log_process_output = options.process_output == 'stdout' get_default_logger("process").component_filter = \ lambda data: data if log_process_output else None # filter some mozversion log lines re_ignore_mozversion_line = re.compile( r"^(platform_.+|application_vendor|application_remotingname" r"|application_id|application_display_name): .+" ) get_default_logger("mozversion").component_filter = lambda data: ( None if re_ignore_mozversion_line.match(data['message']) else data ) self.action = None self.fetch_config = None
import os import json import random import datetime import pyscreenshot as ImageGrab from launchFirefox import FirefoxLauncher from mozregression.log import init_logger logger = init_logger() env = os.environ.copy() app_launch_path = env.get("MOZREGRESSION_BINARY") build_date = env.get("MOZREGRESSION_BUILD_DATE") result_fn = "result.json" if os.path.exists(result_fn): try: with open(result_fn) as read_fh: output_result = json.load(result_fn) except: output_result = {} else: output_result = {} url_list = { "https://www.amazon.com/": { "label": "amazon" }, "https://www.amazon.com/gp/goldbox/ref=nav_cs_gb": { "label": "amazon" }, "https://www.amazon.com/stream/ref=nav_upnav_LargeImage_C_Gateway?pf_rd_m=ATVPDKIKX0DER&pf_rd_s=nav-upnav-msg1&pf_rd_r%5B%5D=56D4NFKYN5BTC49NEZAP&pf_rd_r%5B%5D=56D4NFKYN5BTC49NEZAP&pf_rd_t=4201&pf_rd_p%5B%5D=6071acbf-fe43-448d-8f47-33114e3f82d5&pf_rd_p%5B%5D=6071acbf-fe43-448d-8f47-33114e3f82d5&pf_rd_i=navbar-4201&asCursor=WyIxLjgiLCJ0czEiLCIxNTE1NjQ1NjAwMDAwIiwiIiwiUzAwMDQ6MDpudWxsIiwiUzAwMDQ6MjoxIiwiUzAwMDQ6MDotMSIsIiIsIiIsIjAiLCJzdWIyIiwiMTUxNTY0OTY2Mzg0MSIsImhmMS1zYXZlcyIsIjE1MTU2NDQxMDAwMDAiLCJ2MSIsIjE1MTU2NDk0MjIzMDkiLCJ2MSIsIjE1MDEwMTYzNDk2NTgiLCJ2MSIsIjE1MTU2NDYwMjA5ODIiXQ%3D%3D&asCacheIndex=0&asYOffset=-432":
def init_logger(mocker, **kwargs): stream = StringIO() kwargs["output"] = stream mocker.patch("mozregression.log.set_default_logger") return log.init_logger(**kwargs), stream
def init_logger(mocker, **kwargs): stream = StringIO() kwargs["output"] = stream mocker.patch("mozregression.log.set_default_logger") return log.init_logger(**kwargs), stream