diff --git a/.buildkite/scripts/jdk-matrix-tests/generate-steps.py b/.buildkite/scripts/jdk-matrix-tests/generate-steps.py index aac93c46df3..ab8c2cd43cf 100644 --- a/.buildkite/scripts/jdk-matrix-tests/generate-steps.py +++ b/.buildkite/scripts/jdk-matrix-tests/generate-steps.py @@ -1,4 +1,5 @@ import abc +import copy from dataclasses import dataclass, field import os import sys @@ -7,6 +8,7 @@ from ruamel.yaml import YAML from ruamel.yaml.scalarstring import LiteralScalarString +ENABLED_RETRIES = {"automatic": [{"limit": 3}]} @dataclass class JobRetValues: @@ -15,6 +17,7 @@ class JobRetValues: step_key: str depends: str agent: typing.Dict[typing.Any, typing.Any] + retry: typing.Optional[typing.Dict[typing.Any, typing.Any]] = None artifact_paths: list = field(default_factory=list) @@ -148,6 +151,7 @@ def unit_tests(self) -> JobRetValues: depends=self.init_annotation_key, artifact_paths=["build_reports.zip"], agent=self.agent.to_dict(), + retry=copy.deepcopy(ENABLED_RETRIES), ) @@ -219,6 +223,7 @@ def java_unit_test(self) -> JobRetValues: step_key=step_key, depends=self.init_annotation_key, agent=self.agent.to_dict(), + retry=copy.deepcopy(ENABLED_RETRIES), ) def ruby_unit_test(self) -> JobRetValues: @@ -234,6 +239,7 @@ def ruby_unit_test(self) -> JobRetValues: step_key=step_key, depends=self.init_annotation_key, agent=self.agent.to_dict(), + retry=copy.deepcopy(ENABLED_RETRIES), ) def integration_tests_part_1(self) -> JobRetValues: @@ -255,6 +261,7 @@ def integration_tests(self, part: int) -> JobRetValues: step_key=step_key, depends=self.init_annotation_key, agent=self.agent.to_dict(), + retry=copy.deepcopy(ENABLED_RETRIES), ) def pq_integration_tests_part_1(self) -> JobRetValues: @@ -277,6 +284,7 @@ def pq_integration_tests(self, part: int) -> JobRetValues: step_key=step_key, depends=self.init_annotation_key, agent=self.agent.to_dict(), + retry=copy.deepcopy(ENABLED_RETRIES), ) def x_pack_unit_tests(self) -> JobRetValues: @@ -292,6 +300,7 @@ def x_pack_unit_tests(self) -> JobRetValues: step_key=step_key, depends=self.init_annotation_key, agent=self.agent.to_dict(), + retry=copy.deepcopy(ENABLED_RETRIES), ) def x_pack_integration(self) -> JobRetValues: @@ -307,6 +316,7 @@ def x_pack_integration(self) -> JobRetValues: step_key=step_key, depends=self.init_annotation_key, agent=self.agent.to_dict(), + retry=copy.deepcopy(ENABLED_RETRIES), ) @@ -361,6 +371,9 @@ def x_pack_integration(self) -> JobRetValues: if job_values.artifact_paths: step["artifact_paths"] = job_values.artifact_paths + if job_values.retry: + step["retry"] = job_values.retry + step["command"] = job_values.command group_steps.append(step)