def get_evg_task_config(task: Task, build_variant_config: Variant) -> Dict[str, Any]: """ Look up task config of the task to be generated. :param task: Task to get info for. :param build_variant_config: Config of build variant to collect task info from. :return: Task configuration values. """ LOGGER.info("Calculating evg_task_config values for task", task=task.name) task_vars = {} for run_task_func in POSSIBLE_RUN_TASK_FUNCS: task_def = task.find_func_command(run_task_func) if task_def: task_vars = task_def.get("vars", {}) break task_vars.update({"suite": task.get_suite_name()}) task_name = task.name[:-4] if task.name.endswith("_gen") else task.name return { "task_name": task_name, "build_variant": build_variant_config.name, **task_vars, "large_distro_name": build_variant_config.expansion("large_distro_name"), }
def get_evg_task_config(task: Task, build_variant_config: Variant) -> Dict[str, Any]: """ Look up task config of the task to be generated. :param task: Task to get info for. :param build_variant_config: Config of build variant to collect task info from. :return: Task configuration values. """ LOGGER.info("Calculating evg_task_config values for task", task=task.name) task_vars = {} for run_task_func in POSSIBLE_RUN_TASK_FUNCS: task_def = task.find_func_command(run_task_func) if task_def: task_vars = task_def["vars"] break suite_name = ResmokeArgs.get_arg(task_vars["resmoke_args"], "suites") if suite_name: task_vars.update({"suite": suite_name}) # the suites argument will run all tests in a suite even when individual # tests are specified in resmoke_args, so we remove it resmoke_args_without_suites = ResmokeArgs.remove_arg( task_vars["resmoke_args"], "suites") task_vars["resmoke_args"] = resmoke_args_without_suites task_name = task.name[:-4] if task.name.endswith("_gen") else task.name return { "task_name": task_name, "build_variant": build_variant_config.name, **task_vars, "large_distro_name": build_variant_config.expansion("large_distro_name"), }