summaryrefslogtreecommitdiff
path: root/buildscripts
diff options
context:
space:
mode:
authorMikhail Shchatko <mikhail.shchatko@mongodb.com>2021-10-27 16:39:57 +0300
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2021-10-27 15:25:45 +0000
commitb974dfd8389196bb7e744b7e19b7b48954c7dd40 (patch)
tree92878a459b20a903d24f2bc259434f93044ac98c /buildscripts
parent908e394d39b223ce498fde0d40e18c9200c188e2 (diff)
downloadmongo-b974dfd8389196bb7e744b7e19b7b48954c7dd40.tar.gz
SERVER-57723 Deduplicate last-continuous and last-lts multiversion tasks if the versions are identical
Diffstat (limited to 'buildscripts')
-rw-r--r--buildscripts/task_generation/task_types/multiversion_decorator.py16
1 files changed, 15 insertions, 1 deletions
diff --git a/buildscripts/task_generation/task_types/multiversion_decorator.py b/buildscripts/task_generation/task_types/multiversion_decorator.py
index beb47392828..b0203919c64 100644
--- a/buildscripts/task_generation/task_types/multiversion_decorator.py
+++ b/buildscripts/task_generation/task_types/multiversion_decorator.py
@@ -2,6 +2,7 @@
import copy
from typing import List, Set, Union, Optional
+import structlog
from shrub.v2 import Task, FunctionCall
from shrub.v2.command import ShrubCommand
@@ -9,6 +10,8 @@ from buildscripts.task_generation.constants import DO_MULTIVERSION_SETUP, CONFIG
from buildscripts.task_generation.resmoke_proxy import ResmokeProxyService
from buildscripts.util import taskname
+LOGGER = structlog.get_logger(__name__)
+
class _SuiteFixtureType:
"""Suite fixture types."""
@@ -26,7 +29,7 @@ class MultiversionGenTaskDecorator:
def __init__(self):
"""Initialize multiversion decorator."""
self.resmoke_proxy = ResmokeProxyService()
- self.old_versions = ["last_lts", "last_continuous"]
+ self.old_versions = self._init_old_versions()
def decorate_tasks(self, sub_tasks: Set[Task], params) -> Set[Task]:
"""Make multiversion subtasks based on generated subtasks."""
@@ -51,6 +54,17 @@ class MultiversionGenTaskDecorator:
dependencies=sub_task.dependencies))
return decorated_tasks
+ def _init_old_versions(self) -> List[str]:
+ from buildscripts.resmokelib import multiversionconstants
+ if multiversionconstants.LAST_LTS_FCV == multiversionconstants.LAST_CONTINUOUS_FCV:
+ LOGGER.debug("Last-lts FCV and last-continuous FCV are equal")
+ old_versions = ["last_lts"]
+ else:
+ old_versions = ["last_lts", "last_continuous"]
+ LOGGER.debug("Determined old versions for the multiversion tasks",
+ old_versions=old_versions)
+ return old_versions
+
def _get_suite_fixture_type(self, suite_name: str) -> str:
"""Return suite fixture type."""
source_config = self.resmoke_proxy.read_suite_config(suite_name)