summaryrefslogtreecommitdiff
path: root/buildscripts
diff options
context:
space:
mode:
authorMikhail Shchatko <mikhail.shchatko@mongodb.com>2022-02-15 08:24:01 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2022-02-15 08:51:14 +0000
commit7bd6a08e6ed1f308cba776cb1c71d9ccb3c0dfbe (patch)
tree0adcce63d973897c807ac38deb71b5f2efc6a9ef /buildscripts
parentd02536f48aee7593077c12b1e60829b9441a7c08 (diff)
downloadmongo-7bd6a08e6ed1f308cba776cb1c71d9ccb3c0dfbe.tar.gz
SERVER-61686 Fix multiversion tags in burn_in_tests
Diffstat (limited to 'buildscripts')
-rw-r--r--buildscripts/evergreen_burn_in_tests.py38
-rw-r--r--buildscripts/patch_builds/task_generation.py4
-rw-r--r--buildscripts/task_generation/constants.py4
3 files changed, 23 insertions, 23 deletions
diff --git a/buildscripts/evergreen_burn_in_tests.py b/buildscripts/evergreen_burn_in_tests.py
index 9e0f530aea4..7ac28e4063c 100644
--- a/buildscripts/evergreen_burn_in_tests.py
+++ b/buildscripts/evergreen_burn_in_tests.py
@@ -22,7 +22,7 @@ from buildscripts.patch_builds.evg_change_data import generate_revision_map_from
from buildscripts.patch_builds.task_generation import TimeoutInfo, resmoke_commands, \
validate_task_generation_limit
from buildscripts.task_generation.constants import CONFIG_FILE, EVERGREEN_FILE, ARCHIVE_DIST_TEST_DEBUG_TASK, \
- EXCLUDES_TAGS_FILE_PATH, BACKPORT_REQUIRED_TAG
+ BACKPORT_REQUIRED_TAG, RUN_TESTS, EXCLUDES_TAGS_FILE
from buildscripts.task_generation.suite_split import SubSuite, GeneratedSuite
from buildscripts.task_generation.task_types.resmoke_tasks import EXCLUDE_TAGS
from buildscripts.util.fileops import write_file
@@ -215,26 +215,28 @@ class BurnInGenTaskService:
return TimeoutInfo.default_timeout()
- def _generate_resmoke_args(self, task_name: str, suite_name: str, params: BurnInGenTaskParams,
- test_arg: str) -> str:
+ def _generate_run_tests_vars(self, task_name: str, suite_name: str, params: BurnInGenTaskParams,
+ test_arg: str) -> Dict[str, str]:
+ run_test_vars = {"suite": suite_name}
+
resmoke_args = f"{params.resmoke_args} {self.repeat_config.generate_resmoke_options()} {test_arg}"
if params.require_multiversion_setup:
+ run_test_vars["require_multiversion_setup"] = params.require_multiversion_setup
+
# TODO: inspect the suite for version instead of doing string parsing on the name.
- tag_file_base_path = EXCLUDES_TAGS_FILE_PATH[:-4]
if "last_continuous" in suite_name:
- tag_file = f"{tag_file_base_path}_last_continuous.yml"
+ run_test_vars["multiversion_exclude_tags_version"] = "last_continuous"
+ resmoke_args += f" --tagFile={EXCLUDES_TAGS_FILE}"
elif "last_lts" in suite_name:
- tag_file = f"{tag_file_base_path}_last_lts.yml"
- else:
- tag_file = None
-
- if tag_file is not None:
- resmoke_args += f" --tagFile={tag_file}"
+ run_test_vars["multiversion_exclude_tags_version"] = "last_lts"
+ resmoke_args += f" --tagFile={EXCLUDES_TAGS_FILE}"
resmoke_args += f" --excludeWithAnyTags={EXCLUDE_TAGS},{task_name}_{BACKPORT_REQUIRED_TAG} "
- return resmoke_args
+ run_test_vars["resmoke_args"] = resmoke_args
+
+ return run_test_vars
def _generate_task_name(self, gen_suite: GeneratedSuite, index: int) -> str:
"""
@@ -250,7 +252,7 @@ class BurnInGenTaskService:
return name_generated_task(f"{prefix}:{task_name}", index, len(gen_suite),
self.generate_config.run_build_variant)
- def generate_tasks(self, gen_suite: GeneratedSuite, params: BurnInGenTaskParams) -> List[Task]:
+ def generate_tasks(self, gen_suite: GeneratedSuite, params: BurnInGenTaskParams) -> Set[Task]:
"""Create the task configuration for the given test using the given index."""
tasks = set()
@@ -260,15 +262,11 @@ class BurnInGenTaskService:
f"Can only run one test per suite in burn-in; got {suite.test_list}")
test_name = suite.test_list[0]
test_unix_style = test_name.replace('\\', '/')
- run_tests_vars = {
- "suite":
- gen_suite.suite_name, "resmoke_args":
- self._generate_resmoke_args(gen_suite.task_name, gen_suite.suite_name,
- params, test_unix_style)
- }
+ run_tests_vars = self._generate_run_tests_vars(
+ gen_suite.task_name, gen_suite.suite_name, params, test_unix_style)
timeout_cmd = self.generate_timeouts(test_name)
- commands = resmoke_commands("run tests", run_tests_vars, timeout_cmd,
+ commands = resmoke_commands(RUN_TESTS, run_tests_vars, timeout_cmd,
params.require_multiversion_setup)
dependencies = {TaskDependency(ARCHIVE_DIST_TEST_DEBUG_TASK)}
diff --git a/buildscripts/patch_builds/task_generation.py b/buildscripts/patch_builds/task_generation.py
index d8d9ff267d4..7eb0e3f5bf2 100644
--- a/buildscripts/patch_builds/task_generation.py
+++ b/buildscripts/patch_builds/task_generation.py
@@ -7,7 +7,7 @@ from shrub.v2 import FunctionCall, ShrubProject
from shrub.v2.command import timeout_update, ShrubCommand
from structlog import get_logger
-from buildscripts.task_generation.constants import CONFIGURE_EVG_CREDENTIALS
+from buildscripts.task_generation.constants import CONFIGURE_EVG_CREDENTIALS, DO_MULTIVERSION_SETUP
LOGGER = get_logger(__name__)
MAX_SHRUB_TASKS_FOR_SINGLE_TASK = 1000
@@ -47,7 +47,7 @@ def resmoke_commands(run_tests_fn_name: str, run_tests_vars: Dict[str, Any],
FunctionCall("add git tag") if require_multiversion_setup else None,
FunctionCall("do setup"),
FunctionCall(CONFIGURE_EVG_CREDENTIALS),
- FunctionCall("do multiversion setup") if require_multiversion_setup else None,
+ FunctionCall(DO_MULTIVERSION_SETUP) if require_multiversion_setup else None,
FunctionCall(run_tests_fn_name, run_tests_vars),
]
diff --git a/buildscripts/task_generation/constants.py b/buildscripts/task_generation/constants.py
index 31531d3592d..528d2a3e51b 100644
--- a/buildscripts/task_generation/constants.py
+++ b/buildscripts/task_generation/constants.py
@@ -13,7 +13,8 @@ MAX_WORKERS = 16
LOOKBACK_DURATION_DAYS = 14
MAX_TASK_PRIORITY = 99
GENERATED_CONFIG_DIR = "generated_resmoke_config"
-EXCLUDES_TAGS_FILE_PATH = os.path.join(GENERATED_CONFIG_DIR, "multiversion_exclude_tags.yml")
+EXCLUDES_TAGS_FILE = "multiversion_exclude_tags.yml"
+EXCLUDES_TAGS_FILE_PATH = os.path.join(GENERATED_CONFIG_DIR, EXCLUDES_TAGS_FILE)
GEN_PARENT_TASK = "generator_tasks"
EXPANSION_RE = re.compile(r"\${(?P<id>[a-zA-Z0-9_]+)(\|(?P<default>.*))?}")
BACKPORT_REQUIRED_TAG = "backport_required_multiversion"
@@ -22,3 +23,4 @@ BACKPORT_REQUIRED_TAG = "backport_required_multiversion"
CONFIGURE_EVG_CREDENTIALS = "configure evergreen api credentials"
DO_MULTIVERSION_SETUP = "do multiversion setup"
RUN_GENERATED_TESTS = "run generated tests"
+RUN_TESTS = "run tests"