def build_mock_task(name, run_vars=None):
    config = {
        "name":
            name, "commands": [
                {"func": "do setup"},
                {
                    "func": "generate resmoke tasks",
                    "vars": run_vars if run_vars else {},
                },
            ]
    }
    return Task(config)
Exemplo n.º 2
0
    def generate_build_variant(self, build_variant_config: Variant,
                               changed_files: Set[str],
                               builder: EvgConfigBuilder) -> None:
        """
        Generate the selected tasks on the specified build variant.

        :param build_variant_config: Configuration of build variant to generate.
        :param changed_files: List of file changes to determine what to run.
        :param builder: Builder to create new configuration.
        """
        build_variant_name = build_variant_config.name
        LOGGER.info("Generating build variant",
                    build_variant=build_variant_name)
        task_configs = self.get_task_config(build_variant_config,
                                            changed_files)

        for task_config in task_configs.values():
            task_def = Task(task_config)
            test_filter = None
            if "selected_tests_to_run" in task_config:
                test_filter = partial(
                    filter_set, input_set=task_config["selected_tests_to_run"])
            split_params = SuiteSplitParameters(
                build_variant=build_variant_name,
                task_name=task_config["task_name"],
                suite_name=task_config.get("suite", task_config["task_name"]),
                filename=task_config.get("suite", task_config["task_name"]),
                test_file_filter=test_filter,
                is_asan=build_variant_config.is_asan_build(),
            )
            gen_params = ResmokeGenTaskParams(
                use_large_distro=task_config.get("use_large_distro", False),
                large_distro_name=task_config.get("large_distro_name"),
                require_multiversion_setup=task_def.require_multiversion_setup(
                ),
                require_multiversion_version_combo=False,
                repeat_suites=task_config.get("repeat_suites", 1),
                resmoke_args=task_config.get("resmoke_args", ""),
                resmoke_jobs_max=task_config.get("resmoke_jobs_max"),
                config_location=self.evg_expansions.get_config_location(),
                dependencies={
                    depends_on["name"]
                    for depends_on in task_def.depends_on
                },
            )
            builder.generate_suite(split_params, gen_params)
Exemplo n.º 3
0
def build_mock_task(name, run_vars=None, depends_on=None):
    config = {
        "name":
        name,
        "commands": [
            {
                "func": "do setup"
            },
            {
                "func": "generate resmoke tasks",
                "vars": run_vars if run_vars else {},
            },
        ]
    }

    if depends_on is not None:
        config["depends_on"] = depends_on
    return Task(config)