-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ci] JDK matrix Buildkite pipelines (pt 2/Windows) #15563
Merged
Merged
Changes from 1 commit
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
# ******************************************************** | ||
# This file contains prerequisite bootstrap invocations | ||
# required for Logstash CI JDK matrix tests | ||
# ******************************************************** | ||
|
||
param ( | ||
[string]$JDK, | ||
[string]$CIScript, | ||
[string]$StepNameHuman, | ||
[string]$AnnotateContext, | ||
[switch]$Annotate | ||
) | ||
|
||
# expand previous buildkite folded section (command invocation) | ||
Write-Host "^^^ +++" | ||
|
||
# the unit test script expects the WORKSPACE env var | ||
$env:WORKSPACE = $PWD.Path | ||
|
||
# unset generic JAVA_HOME | ||
if (Test-Path env:JAVA_HOME) { | ||
Remove-Item -Path env:JAVA_HOME | ||
Write-Host "--- Environment variable 'JAVA_HOME' has been unset." | ||
} else { | ||
Write-Host "--- Environment variable 'JAVA_HOME' doesn't exist. Continuing." | ||
} | ||
|
||
# LS env vars for JDK matrix tests | ||
$JAVA_CUSTOM_DIR = "C:\Users\buildkite\.java\$JDK" | ||
$env:BUILD_JAVA_HOME = $JAVA_CUSTOM_DIR | ||
$env:RUNTIME_JAVA_HOME = $JAVA_CUSTOM_DIR | ||
$env:LS_JAVA_HOME = $JAVA_CUSTOM_DIR | ||
|
||
Write-Host "--- Running test: $CIScript" | ||
try { | ||
Invoke-Expression $CIScript | ||
|
||
if ($LASTEXITCODE -ne 0) { | ||
throw "Test script $CIScript failed with a non-zero code: $LASTEXITCODE" | ||
} | ||
|
||
if ($Annotate) { | ||
C:\buildkite-agent\bin\buildkite-agent.exe annotate --context="$AnnotateContext" --append "| :bk-status-passed: | $StepNameHuman |`n" | ||
} | ||
} catch { | ||
# tests failed | ||
Write-Host "^^^ +++" | ||
if ($Annotate) { | ||
C:\buildkite-agent\bin\buildkite-agent.exe annotate --context="$AnnotateContext" --append "| :bk-status-failed: | $StepNameHuman |`n" | ||
Write-Host "--- Archiving test reports" | ||
& "7z.exe" a -r .\build_reports.zip .\logstash-core\build\reports\tests | ||
} | ||
exit 1 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,65 @@ | ||
steps: | ||
- label: "Test Windows JDK matrix pipeline" | ||
command: "echo 'Hello world'" | ||
- input: "Test Parameters" | ||
if: build.source != "schedule" | ||
fields: | ||
- select: "Operating System" | ||
key: "matrix-os" | ||
hint: "The operating system variant(s) to run on:" | ||
required: true | ||
multiple: true | ||
default: "windows-2022" | ||
options: | ||
- label: "Windows 2022" | ||
value: "windows-2022" | ||
- label: "Windows 2019" | ||
value: "windows-2019" | ||
- label: "Windows 2016" | ||
value: "windows-2016" | ||
|
||
- select: "Java" | ||
key: "matrix-jdk" | ||
hint: "The JDK to test with:" | ||
required: true | ||
multiple: true | ||
default: "adoptiumjdk_17" | ||
options: | ||
- label: "Adoptium JDK 17 (Eclipse Temurin)" | ||
value: "adoptiumjdk_17" | ||
- label: "Adopt OpenJDK 11" | ||
value: "adoptopenjdk_11" | ||
- label: "OpenJDK 17" | ||
value: "openjdk_17" | ||
- label: "OpenJDK 11" | ||
value: "openjdk_11" | ||
- label: "Zulu 17" | ||
value: "zulu_17" | ||
- label: "Zulu 11" | ||
value: "zulu_11" | ||
|
||
- wait: ~ | ||
if: build.source != "schedule" | ||
|
||
- command: | | ||
set -euo pipefail | ||
|
||
echo "--- Downloading prerequisites" | ||
python3 -m pip install ruamel.yaml | ||
|
||
echo "--- Printing generated dynamic steps" | ||
export MATRIX_OSES="$(buildkite-agent meta-data get matrix-os)" | ||
export MATRIX_JDKS="$(buildkite-agent meta-data get matrix-jdk)" | ||
set +eo pipefail | ||
python3 .buildkite/scripts/jdk-matrix-tests/generate-steps.py >pipeline_steps.yml | ||
if [[ $$? -ne 0 ]]; then | ||
echo "^^^ +++" | ||
echo "There was a problem rendering the pipeline steps." | ||
cat pipeline_steps.yml | ||
echo "Exiting now." | ||
exit 1 | ||
else | ||
set -eo pipefail | ||
cat pipeline_steps.yml | ||
fi | ||
|
||
echo "--- Uploading steps to buildkite" | ||
cat pipeline_steps.yml | buildkite-agent pipeline upload |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The only neat here is to maybe do "Unit Tests (Java/Ruby)"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great idea. Added it in 491fed5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
raised #15566 to track the improvement