Ejemplo n.º 1
0
def activate_task(build_id: str, task_name: str, evg_api: EvergreenApi) -> None:
    """
    Activate the given task in the specified build.

    :param build_id: Build to activate task in.
    :param task_name: Name of task to activate.
    :param evg_api: Evergreen API client.
    """
    build = evg_api.build_by_id(build_id)
    task_list = build.get_tasks()
    for task in task_list:
        if task.display_name == task_name:
            LOGGER.info("Activating task", task_id=task.task_id, task_name=task.display_name)
            evg_api.configure_task(task.task_id, activated=True)
Ejemplo n.º 2
0
def activate_task(build_id: str, task_name: str,
                  evg_api: EvergreenApi) -> None:
    """
    Activate the given task in the specified build.

    :param build_id: Build to activate task in.
    :param task_name: Name of task to activate.
    :param evg_api: Evergreen API client.
    """
    build = evg_api.build_by_id(build_id)
    task_list = build.get_tasks()
    for task in task_list:
        if task.display_name == task_name:
            LOGGER.info("Activating task",
                        task_id=task.task_id,
                        task_name=task.display_name)
            evg_api.configure_task(task.task_id, activated=True)

            if any(ARCHIVE_DIST_TEST_TASK in dependency["id"]
                   for dependency in task.depends_on):
                _activate_archive_debug_symbols(evg_api, task_list)
Ejemplo n.º 3
0
def activate_task(expansions: EvgExpansions, evg_api: EvergreenApi) -> None:
    """
    Activate the given task in the specified build.

    :param expansions: Evergreen expansions file contents.
    :param evg_api: Evergreen API client.
    """
    if expansions.task == BURN_IN_TAGS:
        version = evg_api.version_by_id(expansions.version_id)
        for base_build_variant in expansions.burn_in_tag_buildvariants_list:
            build_variant = f"{base_build_variant}-required"
            try:
                build = version.build_by_variant(build_variant)
            except KeyError:
                LOGGER.warning(
                    "It is likely nothing to burn_in, so burn_in_tags build variant"
                    " was not generated. Skipping...",
                    build_variant=build_variant)
                continue

            task_list = build.get_tasks()
            for task in task_list:
                if task.display_name == BURN_IN_TESTS:
                    LOGGER.info("Activating task",
                                task_id=task.task_id,
                                task_name=task.display_name)
                    evg_api.configure_task(task.task_id, activated=True)

    else:
        build = evg_api.build_by_id(expansions.build_id)
        task_list = build.get_tasks()
        for task in task_list:
            if task.display_name == expansions.task:
                LOGGER.info("Activating task",
                            task_id=task.task_id,
                            task_name=task.display_name)
                evg_api.configure_task(task.task_id, activated=True)