Skip to content

Commit fb7e0ec

Browse files
dliappismergify[bot]
authored andcommitted
Fix JDK matrix pipeline after configurable it split (#17461)
PR #17219 introduced configurable split quantities for IT tests, which resulted in broken JDK matrix pipelines (e.g. as seen via the elastic internal link: https://buildkite.com/elastic/logstash-linux-jdk-matrix-pipeline/builds/444 reporting the following error ``` File "/buildkite/builds/bk-agent-prod-k8s-1743469287077752648/elastic/logstash-linux-jdk-matrix-pipeline/.buildkite/scripts/jdk-matrix-tests/generate-steps.py", line 263 def integration_tests(self, part: int, parts: int) -> JobRetValues: ^^^ SyntaxError: invalid syntax There was a problem rendering the pipeline steps. Exiting now. ``` ) This commit fixes the above problem, which was already fixed in #17642, using a more idiomatic way. Co-authored-by: Andrea Selva <[email protected]> (cherry picked from commit b9469e0)
1 parent e5387e0 commit fb7e0ec

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

Diff for: .buildkite/scripts/jdk-matrix-tests/generate-steps.py

+5-4
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import os
55
import sys
66
import typing
7+
from functools import partial
78

89
from ruamel.yaml import YAML
910
from ruamel.yaml.scalarstring import LiteralScalarString
@@ -257,8 +258,8 @@ def ruby_unit_test(self) -> JobRetValues:
257258
retry=copy.deepcopy(ENABLED_RETRIES),
258259
)
259260

260-
def integration_test_parts(self, parts) -> list[JobRetValues]:
261-
return list(map(lambda idx: integration_tests(self, idx+1, parts), range(parts)))
261+
def integration_test_parts(self, parts) -> list[partial[JobRetValues]]:
262+
return [partial(self.integration_tests, part=idx+1, parts=parts) for idx in range(parts)]
262263

263264
def integration_tests(self, part: int, parts: int) -> JobRetValues:
264265
step_name_human = f"Integration Tests - {part}/{parts}"
@@ -276,8 +277,8 @@ def integration_tests(self, part: int, parts: int) -> JobRetValues:
276277
retry=copy.deepcopy(ENABLED_RETRIES),
277278
)
278279

279-
def pq_integration_test_parts(self, parts) -> list[JobRetValues]:
280-
return list(map(lambda idx: pq_integration_tests(self, idx+1, parts), range(parts)))
280+
def pq_integration_test_parts(self, parts) -> list[partial[JobRetValues]]:
281+
return [partial(self.pq_integration_tests, part=idx+1, parts=parts) for idx in range(parts)]
281282

282283
def pq_integration_tests(self, part: int, parts: int) -> JobRetValues:
283284
step_name_human = f"IT Persistent Queues - {part}/{parts}"

0 commit comments

Comments
 (0)