Ejemplo n.º 1
0
def get_mozharness_status(lines, status):
    parser = StructuredOutputParser(
        config={'log_level': INFO},
        error_list=BaseErrorList + HarnessErrorList,
        strict=False,
        suite_category='mochitest',
    )

    for line in lines:
        parser.parse_single_line(json.dumps(line))
    return parser.evaluate_parser(status)
Ejemplo n.º 2
0
def get_mozharness_status(lines, status):
    parser = StructuredOutputParser(
        config={'log_level': INFO},
        error_list=BaseErrorList + HarnessErrorList,
        strict=False,
        suite_category='mochitest',
    )

    # Processing the log with mozharness will re-print all the output to stdout
    # Since this exact same output has already been printed by the actual test
    # run, temporarily redirect stdout to devnull.
    with open(os.devnull, 'w') as fh:
        orig = sys.stdout
        sys.stdout = fh
        for line in lines:
            parser.parse_single_line(json.dumps(line))
        sys.stdout = orig
    return parser.evaluate_parser(status)
Ejemplo n.º 3
0
def get_mozharness_status(suite, lines, status, formatter=None, buf=None):
    """Given list of log lines, determine what the mozharness status would be."""
    parser = StructuredOutputParser(
        config={'log_level': INFO},
        error_list=BaseErrorList + HarnessErrorList,
        strict=False,
        suite_category=suite,
    )

    if formatter:
        parser.formatter = formatter

    # Processing the log with mozharness will re-print all the output to stdout
    # Since this exact same output has already been printed by the actual test
    # run, temporarily redirect stdout to devnull.
    buf = buf or open(os.devnull, 'w')
    orig = sys.stdout
    sys.stdout = buf
    for line in lines:
        parser.parse_single_line(json.dumps(line))
    sys.stdout = orig
    return parser.evaluate_parser(status)
Ejemplo n.º 4
0
def get_mozharness_status(suite, lines, status, formatter=None, buf=None):
    """Given list of log lines, determine what the mozharness status would be."""
    parser = StructuredOutputParser(
        config={'log_level': INFO},
        error_list=BaseErrorList+HarnessErrorList,
        strict=False,
        suite_category=suite,
    )

    if formatter:
        parser.formatter = formatter

    # Processing the log with mozharness will re-print all the output to stdout
    # Since this exact same output has already been printed by the actual test
    # run, temporarily redirect stdout to devnull.
    buf = buf or open(os.devnull, 'w')
    orig = sys.stdout
    sys.stdout = buf
    for line in lines:
        parser.parse_single_line(json.dumps(line))
    sys.stdout = orig
    return parser.evaluate_parser(status)