Skip to content

Commit

Permalink
Split java/ruby unit test steps on Windows
Browse files Browse the repository at this point in the history
As a follow up to elastic#15861 this commit splits the current unit tests step
for the Windows JDK matrix pipeline to two that run
Java and Ruby unit tests separately.

Closes elastic#15566
  • Loading branch information
dliappis committed Feb 1, 2024
1 parent 8ac5518 commit 2e7a3cd
Showing 1 changed file with 22 additions and 5 deletions.
27 changes: 22 additions & 5 deletions .buildkite/scripts/jdk-matrix-tests/generate-steps.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,13 +135,30 @@ def __init__(self, os: str, jdk: str, group_key: str, agent: typing.Union[GCPAge
def all_jobs(self) -> list[typing.Callable[[], JobRetValues]]:
return [
self.init_annotation,
self.unit_tests,
self.java_unit_test,
self.ruby_unit_test,
]

def unit_tests(self) -> JobRetValues:
step_name_human = "Unit Test (Java/Ruby)"
step_key = f"{self.group_key}-unit-test"
test_command = rf'''.\\.buildkite\\scripts\\jdk-matrix-tests\\launch-command.ps1 -JDK "{self.jdk}" -StepNameHuman "{step_name_human}" -AnnotateContext "{self.group_key}" -CIScript ".\\ci\\unit_tests.ps1" -Annotate
def java_unit_test(self) -> JobRetValues:
step_name_human = "Java Unit Test"
step_key = f"{self.group_key}-java-unit-test"
test_command = rf'''.\\.buildkite\\scripts\\jdk-matrix-tests\\launch-command.ps1 -JDK "{self.jdk}" -StepNameHuman "{step_name_human}" -AnnotateContext "{self.group_key}" -CIScript ".\\ci\\unit_tests.ps1 java" -Annotate
'''

return JobRetValues(
step_label=step_name_human,
command=LiteralScalarString(test_command),
step_key=step_key,
depends=self.init_annotation_key,
artifact_paths=["build_reports.zip"],
agent=self.agent.to_dict(),
retry=copy.deepcopy(ENABLED_RETRIES),
)

def ruby_unit_test(self) -> JobRetValues:
step_name_human = "Ruby Unit Test"
step_key = f"{self.group_key}-ruby-unit-test"
test_command = rf'''.\\.buildkite\\scripts\\jdk-matrix-tests\\launch-command.ps1 -JDK "{self.jdk}" -StepNameHuman "{step_name_human}" -AnnotateContext "{self.group_key}" -CIScript ".\\ci\\unit_tests.ps1 ruby" -Annotate
'''

return JobRetValues(
Expand Down

0 comments on commit 2e7a3cd

Please sign in to comment.