Ejemplo n.º 1
0
def get_bad_tests(build_url, is_yetus):
    """
    Given url of an executed build, analyzes its maven output, and returns
    [list of all tests, list of timeout tests, list of failed tests].
    Returns None if can't get maven output from the build or if there is any other error.
    """
    logger.info("Analyzing %s", build_url)
    response = requests.get(build_url + "/api/json").json()
    if response["building"]:
        logger.info("Skipping this build since it is in progress.")
        return {}
    console_url = None
    if is_yetus:
        for artifact in response["artifacts"]:
            if artifact["fileName"] == "patch-unit-root.txt":
                console_url = build_url + "/artifact/" + artifact["relativePath"]
                break
        if console_url is None:
            logger.info("Can't find 'patch-unit-root.txt' artifact for Yetus build %s\n. Ignoring "
                        "this build.", build_url)
            return
    else:
        console_url = build_url + "/consoleText"
    build_result = findHangingTests.get_bad_tests(console_url)
    if not build_result:
        logger.info("Ignoring build %s", build_url)
        return
    return build_result
Ejemplo n.º 2
0
def get_bad_tests(build_url):
    logger.info("Analyzing %s", build_url)
    json_response = requests.get(build_url + "/api/json").json()
    if json_response["building"]:
        logger.info("Skipping this build since it is in progress.")
        return {}
    console_url = build_url + "/consoleText"
    return findHangingTests.get_bad_tests(console_url)
Ejemplo n.º 3
0
def get_bad_tests(build_url):
    """
    Given url of an executed build, analyzes its console text, and returns
    [list of all tests, list of timeout tests, list of failed tests].
    Returns None if can't get console text or if there is any other error.
    """
    logger.info("Analyzing %s", build_url)
    response = requests.get(build_url + "/api/json").json()
    if response["building"]:
        logger.info("Skipping this build since it is in progress.")
        return {}
    console_url = build_url + "/consoleText"
    build_result = findHangingTests.get_bad_tests(console_url)
    if not build_result:
        logger.info("Ignoring build %s", build_url)
        return
    return build_result
Ejemplo n.º 4
0
def get_bad_tests(build_url):
    """
    Given url of an executed build, analyzes its console text, and returns
    [list of all tests, list of timeout tests, list of failed tests].
    Returns None if can't get console text or if there is any other error.
    """
    logger.info("Analyzing %s", build_url)
    response = requests.get(build_url + "/api/json").json()
    if response["building"]:
        logger.info("Skipping this build since it is in progress.")
        return {}
    console_url = build_url + "/consoleText"
    build_result = findHangingTests.get_bad_tests(console_url)
    if not build_result:
        logger.info("Ignoring build %s", build_url)
        return
    return build_result