-
Notifications
You must be signed in to change notification settings - Fork 165
Draft, on hold: Run tests on Windows #1111
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
base: develop
Are you sure you want to change the base?
Conversation
📝 WalkthroughWalkthroughThis update standardizes Docker entrypoint and file path handling across the codebase, shifting from Sequence Diagram(s)sequenceDiagram
participant Dev as Developer
participant Pipeline as Azure Pipeline
participant VM as Windows 2022 VM
participant Gradle as Gradle/Test Runner
Dev->>Pipeline: Push code to non-epic/develop/master branch
Pipeline->>VM: Provision Windows 2022 VM
VM->>VM: Install Java 21 (JavaToolInstaller)
VM->>VM: Install Docker (DockerInstaller)
VM->>Gradle: Run tests with ES_MODULE=es90x (PowerShell)
Gradle-->>VM: Test results
alt Test failure
VM->>VM: Check for JVM crash logs
VM->>Pipeline: Publish test results
end
sequenceDiagram
participant ScalaCode as Scala Code
participant PathUtils as PathUtils Utility
participant Docker as Docker-related Classes
ScalaCode->>Docker: Set Docker entrypoint (String)
ScalaCode->>PathUtils: Convert file path to Linux style
PathUtils-->>ScalaCode: Return normalized path (String)
ScalaCode->>Docker: Use normalized path in Docker commands
Note ⚡️ AI Code Reviews for VS Code, Cursor, WindsurfCodeRabbit now has a plugin for VS Code, Cursor and Windsurf. This brings AI code reviews directly in the code editor. Each commit is reviewed immediately, finding bugs before the PR is raised. Seamless context handoff to your AI code agent ensures that you can easily incorporate review feedback. Note ⚡️ Faster reviews with cachingCodeRabbit now supports caching for code and dependencies, helping speed up reviews. This means quicker feedback, reduced wait times, and a smoother review experience overall. Cached data is encrypted and stored securely. This feature will be automatically enabled for all accounts on May 16th. To opt out, configure Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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.
Actionable comments posted: 1
🧹 Nitpick comments (1)
azure-pipelines.yml (1)
79-80
: Missing newline at end of fileYAML files should end with a newline character.
matrix: IT_es90x: ES_MODULE: es90x +
🧰 Tools
🪛 YAMLlint (1.35.1)
[error] 80-80: no new line character at the end of file
(new-line-at-end-of-file)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (8)
azure-pipelines.yml
(1 hunks)ror-tools-core/src/main/scala/tech/beshu/ror/tools/core/patches/internal/filePatchers/JarManifestModifier.scala
(1 hunks)ror-tools/src/test/scala/tech/beshu/ror/tools/RorToolsAppSuite.scala
(1 hunks)ror-tools/src/test/scala/tech/beshu/ror/tools/utils/ExampleEsWithRorContainer.scala
(1 hunks)tests-utils/src/main/scala/tech/beshu/ror/utils/containers/EsContainerWithRorAndXpackSecurity.scala
(3 hunks)tests-utils/src/main/scala/tech/beshu/ror/utils/containers/images/DockerImageCreator.scala
(1 hunks)tests-utils/src/main/scala/tech/beshu/ror/utils/containers/images/DockerImageDescription.scala
(3 hunks)tests-utils/src/main/scala/tech/beshu/ror/utils/containers/images/Elasticsearch.scala
(2 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
tests-utils/src/main/scala/tech/beshu/ror/utils/containers/images/Elasticsearch.scala (1)
tests-utils/src/main/scala/tech/beshu/ror/utils/containers/images/DockerImageDescription.scala (1)
setEntrypoint
(64-66)
🪛 YAMLlint (1.35.1)
azure-pipelines.yml
[error] 80-80: no new line character at the end of file
(new-line-at-end-of-file)
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: ror (Run all tests IT_es90x)
🔇 Additional comments (15)
ror-tools/src/test/scala/tech/beshu/ror/tools/RorToolsAppSuite.scala (1)
513-513
: Minor whitespace addition.Added a blank line for better readability after the assertion in the test.
ror-tools/src/test/scala/tech/beshu/ror/tools/utils/ExampleEsWithRorContainer.scala (1)
108-108
: Refactored entrypoint type from Path to String.Changed
customEntrypoint
fromOption[Path]
toOption[String]
, removing the Path constructor while preserving the shell command string.tests-utils/src/main/scala/tech/beshu/ror/utils/containers/images/DockerImageCreator.scala (1)
87-87
: Updated entrypoint handling to match type changes.Modified the entrypoint parameter handling to directly use the string value without Path conversion, aligning with the broader refactoring of entrypoint types from
Path
toString
.ror-tools-core/src/main/scala/tech/beshu/ror/tools/core/patches/internal/filePatchers/JarManifestModifier.scala (1)
41-41
: Improved error handling to preserve exception cause.Enhanced exception handling by preserving the original exception as the cause when wrapping in a new
IllegalStateException
.tests-utils/src/main/scala/tech/beshu/ror/utils/containers/images/Elasticsearch.scala (2)
57-57
: Type change fromOption[Path]
toOption[String]
aligns with Docker conventionsThis change simplifies the representation of Docker entrypoints as strings rather than Path objects, which is more aligned with how Docker itself handles entrypoints.
75-76
: Updated method signature to match constructor parameter typeThe signature update from
Path
toString
is consistent with the constructor parameter change and enables a more direct representation of Docker entrypoints.tests-utils/src/main/scala/tech/beshu/ror/utils/containers/images/DockerImageDescription.scala (3)
27-27
: Case class field type changed fromOption[Path]
toOption[String]
Simplifies the representation of Docker entrypoints, consistent with other changes. This is a good refactoring that removes unnecessary complexity.
64-66
: Method signature updated to useString
instead ofPath
Ensures consistency with the updated field type.
78-78
: Factory method parameter type updated toOption[String]
Completes the consistent type change across the entire class hierarchy. This is a thorough refactoring approach.
tests-utils/src/main/scala/tech/beshu/ror/utils/containers/EsContainerWithRorAndXpackSecurity.scala (3)
65-65
: Updated parameter type toOption[String]
for consistencyAligns with similar changes in related files, ensuring a consistent approach to Docker entrypoint handling across the codebase.
84-84
: Updated parameter type in private method to maintain consistencyPart of the systematic type change from
Option[Path]
toOption[String]
throughout the codebase.
103-103
: Updated parameter type in another private methodCompletes the consistent type change across all methods that handle Docker entrypoints.
azure-pipelines.yml (3)
49-51
: Changed test environment from Ubuntu to WindowsSwitching to Windows aligns with the PR objective of testing on Windows. This is a targeted approach to verify cross-platform compatibility.
56-61
: Added Java 21 installation steps for WindowsProperly configures the Windows environment with the required Java version.
62-69
: Converted shell script to PowerShell for Windows compatibilityThe PowerShell script appropriately handles test execution and error reporting for the Windows environment.
...main/scala/tech/beshu/ror/tools/core/patches/internal/filePatchers/JarManifestModifier.scala
Outdated
Show resolved
Hide resolved
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.
Actionable comments posted: 2
🧹 Nitpick comments (4)
azure-pipelines.yml (4)
49-50
: Usewindows-latest
image for maintainability.
The pipeline currently pinsvmImage: 'windows-2022'
. Switching towindows-latest
ensures you automatically get updates and security patches without manually bumping the image.
79-80
: Correct the test results file pattern.
The glob**/TEST*xml
can miss Gradle’s default XML reports. Use a more specific pattern such as**/TEST-*.xml
or**/build/test-results/**/*.xml
to reliably capture all test result files.
85-86
: Broaden the ES version matrix if needed.
Right now onlyes90x
is tested. If you support multiple Elasticsearch versions, add additional entries (e.g.,IT_es80x
,IT_es70x
) to the matrix to catch regressions across versions.🧰 Tools
🪛 YAMLlint (1.35.1)
[error] 86-86: no new line character at the end of file
(new-line-at-end-of-file)
86-86
: Add a newline at end of file.
YAML linters expect a trailing newline to avoid warnings like “no new line character at the end of file.”🧰 Tools
🪛 YAMLlint (1.35.1)
[error] 86-86: no new line character at the end of file
(new-line-at-end-of-file)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
azure-pipelines.yml
(1 hunks)
🧰 Additional context used
🪛 YAMLlint (1.35.1)
azure-pipelines.yml
[error] 86-86: no new line character at the end of file
(new-line-at-end-of-file)
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: ror (Run all tests IT_es90x)
🔇 Additional comments (1)
azure-pipelines.yml (1)
56-62
: Verify Java 21 availability on the Windows agent.
You’re using theJavaToolInstaller@0
withjdkSourceOption: 'PreInstalled'
andversionSpec: '21'
. Confirm that the chosen VM image actually includes Java 21. If not, consider switching to a hosted distribution or installing from Azure’s Java distributions.
Write-Host ">>> $env:ES_MODULE => Running testcontainers.." | ||
.\gradlew ror-tools:test "-PesModule=$env:ES_MODULE" | ||
if ($LASTEXITCODE -ne 0) { | ||
Get-ChildItem -Recurse -Filter *hs_err* | ForEach-Object { | ||
Get-Content $_.FullName | ||
} | ||
exit 1 | ||
} |
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.
🛠️ Refactor suggestion
Ensure you run the full test suite.
The current PowerShell block executes only ror-tools:test
. If your goal is to validate all modules, update the command to .\gradlew test
(or include additional tasks). You may also add Gradle flags like --continue
or --fail-fast
to fine-tune failure handling.
🤖 Prompt for AI Agents (early access)
In azure-pipelines.yml around lines 68 to 75, the PowerShell script runs only
the `ror-tools:test` task, which limits test coverage to that module. To run the
full test suite, replace `.\gradlew ror-tools:test "-PesModule=$env:ES_MODULE"`
with `.\gradlew test` or add other relevant test tasks to cover all modules.
Optionally, include Gradle flags like `--continue` or `--fail-fast` to control
how test failures affect the build process.
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.
Actionable comments posted: 0
♻️ Duplicate comments (2)
azure-pipelines.yml (2)
63-67
: Upgrade Docker version to a supported release.
The pipeline currently pins Docker to17.09.0-ce
, which is outdated. Please upgrade to a more recent, supported version (e.g.,20.x
orlatest
) to benefit from security fixes and new features.
68-76
: Ensure full test suite coverage.
The PowerShell block still runs only.\gradlew ror-tools:test "-PesModule=$env:ES_MODULE"
, limiting execution to the ROR tools tests. If the goal is to validate the entire codebase on Windows, consider invoking.\gradlew test
or adding additional tasks.
🧹 Nitpick comments (2)
azure-pipelines.yml (2)
49-50
: Optimize pool selection for future compatibility.
Consider using thewindows-latest
alias instead of hardcodingwindows-2022
. This ensures the pipeline automatically moves to newer supported Windows images when Microsoft updates the hosted pools.
87-87
: Add newline at end of file.
YAML files should end with a newline to satisfy linters and avoid parsing issues.🧰 Tools
🪛 YAMLlint (1.35.1)
[error] 87-87: no new line character at the end of file
(new-line-at-end-of-file)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
azure-pipelines.yml
(1 hunks)ror-tools/src/test/resources/logback.xml
(1 hunks)
✅ Files skipped from review due to trivial changes (1)
- ror-tools/src/test/resources/logback.xml
🧰 Additional context used
🪛 YAMLlint (1.35.1)
azure-pipelines.yml
[error] 87-87: no new line character at the end of file
(new-line-at-end-of-file)
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: ror (Run all tests IT_es90x)
🔇 Additional comments (2)
azure-pipelines.yml (2)
56-62
: Good: Switching to Java 21 on Windows.
TheJavaToolInstaller@0
task correctly installs Java 21 (x64) from the pre-installed options, aligning with the project's move to Java 21. Nice improvement.
86-87
: Verify module matrix scope.
The job matrix includes onlyES_MODULE: es90x
. Is this intentional for this Windows test, or should additional modules be added back? Please confirm the test scope.🧰 Tools
🪛 YAMLlint (1.35.1)
[error] 87-87: no new line character at the end of file
(new-line-at-end-of-file)
# Conflicts: # ror-tools-core/src/main/scala/tech/beshu/ror/tools/core/patches/internal/filePatchers/JarManifestModifier.scala
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.
Actionable comments posted: 1
♻️ Duplicate comments (1)
azure-pipelines.yml (1)
70-70
: Limited test scope for only theror-tools
module
The PowerShell step invokes.\gradlew ror-tools:test
, which runs tests for a single module. If you need full coverage, consider replacing it with a full-suite command like.\gradlew test
.
🧹 Nitpick comments (1)
azure-pipelines.yml (1)
87-87
: Add newline at end of file
YAMLLint flags a missing newline at EOF. Please add a line break after the last line.🧰 Tools
🪛 YAMLlint (1.35.1)
[error] 87-87: no new line character at the end of file
(new-line-at-end-of-file)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge Base: Disabled due to data retention organization setting
📒 Files selected for processing (8)
azure-pipelines.yml
(1 hunks)ror-tools/src/main/scala/tech/beshu/ror/tools/RorToolsApp.scala
(1 hunks)ror-tools/src/test/scala/tech/beshu/ror/tools/RorToolsAppSuite.scala
(32 hunks)tests-utils/src/main/scala/tech/beshu/ror/utils/containers/images/DockerImageCreator.scala
(4 hunks)tests-utils/src/main/scala/tech/beshu/ror/utils/containers/images/Elasticsearch.scala
(4 hunks)tests-utils/src/main/scala/tech/beshu/ror/utils/containers/images/PathUtils.scala
(1 hunks)tests-utils/src/main/scala/tech/beshu/ror/utils/containers/images/ReadonlyRestPlugin.scala
(3 hunks)tests-utils/src/main/scala/tech/beshu/ror/utils/containers/images/XpackSecurityPlugin.scala
(2 hunks)
✅ Files skipped from review due to trivial changes (5)
- tests-utils/src/main/scala/tech/beshu/ror/utils/containers/images/XpackSecurityPlugin.scala
- tests-utils/src/main/scala/tech/beshu/ror/utils/containers/images/PathUtils.scala
- ror-tools/src/main/scala/tech/beshu/ror/tools/RorToolsApp.scala
- tests-utils/src/main/scala/tech/beshu/ror/utils/containers/images/ReadonlyRestPlugin.scala
- ror-tools/src/test/scala/tech/beshu/ror/tools/RorToolsAppSuite.scala
🚧 Files skipped from review as they are similar to previous changes (2)
- tests-utils/src/main/scala/tech/beshu/ror/utils/containers/images/DockerImageCreator.scala
- tests-utils/src/main/scala/tech/beshu/ror/utils/containers/images/Elasticsearch.scala
🧰 Additional context used
🪛 YAMLlint (1.35.1)
azure-pipelines.yml
[error] 87-87: no new line character at the end of file
(new-line-at-end-of-file)
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: ror (Run all tests IT_es90x)
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.
Actionable comments posted: 2
♻️ Duplicate comments (1)
azure-pipelines.yml (1)
72-80
:⚠️ Potential issueCritical: Test execution is limited to a single module
The script runs only.\gradlew ror-tools:test
for the currentES_MODULE
. This excludes other modules and risks missing regressions.Consider running the full suite or including additional module tests. For example:
- .\gradlew ror-tools:test "-PesModule=$env:ES_MODULE" + .\gradlew test "-PesModule=$env:ES_MODULE"
🧹 Nitpick comments (2)
azure-pipelines.yml (2)
63-70
: Optional: Use built-in DockerInstaller task instead of inline script
Replacing the inline PowerShell Docker install with the Azure DevOpsDockerInstaller@0
task improves idempotency and clarity.- - powershell: | - Install-WindowsFeature -Name containers -IncludeAllSubFeature -IncludeManagementTools - Install-WindowsFeature -Name Hyper-V -IncludeAllSubFeature -IncludeManagementTools -Restart:$false - Set-ExecutionPolicy Bypass -Scope Process -Force - Install-Module -Name DockerMsftProvider -Repository PSGallery -Force - Install-Package -Name docker -ProviderName DockerMsftProvider -Force - Start-Service docker - docker version + - task: DockerInstaller@0 + displayName: 'Install Docker on Windows' + inputs: + dockerVersion: 'latest' + includePreview: false
91-91
: Add newline at end of file
Ensure the file ends with a single newline character to satisfy YAML linting rules.🧰 Tools
🪛 YAMLlint (1.35.1)
[error] 91-91: no new line character at the end of file
(new-line-at-end-of-file)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge Base: Disabled due to data retention organization setting
📒 Files selected for processing (1)
azure-pipelines.yml
(1 hunks)
🧰 Additional context used
🪛 YAMLlint (1.35.1)
azure-pipelines.yml
[error] 91-91: no new line character at the end of file
(new-line-at-end-of-file)
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: ror (Run all tests IT_es90x)
🔇 Additional comments (2)
azure-pipelines.yml (2)
49-50
: Approve: Windows VM image update
Switching to thewindows-2022
VM image for the test job aligns with your goal of running tests on Windows Server 2022.
90-91
:❓ Verification inconclusive
Verify test matrix entries
You've narrowed the matrix to onlyIT_es90x
. If other ES modules require Windows-based validation, please confirm or re-add them.
🏁 Script executed:
#!/bin/bash # List matrix entries in azure-pipelines.yml to confirm modules rg -n "matrix:" -A3 azure-pipelines.ymlLength of output: 119
Verify Windows test matrix coverage
Thematrix
inazure-pipelines.yml
(lines 89–91) currently defines only:matrix: IT_es90x: ES_MODULE: es90x
Please confirm whether other ES_MODULE variants still require Windows-based integration tests. If they do, re-add them; otherwise, note that their exclusion is intentional.
🧰 Tools
🪛 YAMLlint (1.35.1)
[error] 91-91: no new line character at the end of file
(new-line-at-end-of-file)
IT_es81x: | ||
ROR_TASK: integration_es81x | ||
IT_es80x: | ||
ROR_TASK: integration_es80x | ||
- job: | ||
condition: and(succeeded(), ne(variables.isEpic, true), ne(variables.isDevelop, true), ne(variables.isMaster, true)) |
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.
Critical: CI tests are skipped on develop and master branches
The condition ne(variables.isDevelop, true)
and ne(variables.isMaster, true)
means this job won't run on develop or master, effectively skipping CI validation on your mainline code.
Please remove or adjust these checks so that tests also run on the develop
and master
branches.
🤖 Prompt for AI Agents
In azure-pipelines.yml at line 47, the condition excludes running CI tests on
develop and master branches by checking ne(variables.isDevelop, true) and
ne(variables.isMaster, true). To fix this, remove these two checks from the
condition so that the job runs on develop and master branches as well, ensuring
CI validation is performed on mainline code.
- task: JavaToolInstaller@0 | ||
displayName: Switch to Java 21 | ||
inputs: | ||
testRunTitle: "$(ROR_TASK) results" | ||
testResultsFiles: "**/TEST*xml" | ||
mergeTestResults: true | ||
strategy: | ||
maxParallel: 99 | ||
matrix: | ||
IT_es90x: | ||
ROR_TASK: integration_es90x | ||
- job: | ||
condition: and(succeeded(), ne(variables.isEpic, true), ne(variables.isDevelop, true), ne(variables.isMaster, true)) | ||
container: openjdk:22-slim | ||
timeoutInMinutes: 120 | ||
steps: | ||
- checkout: self | ||
fetchDepth: 1 | ||
clean: false | ||
persistCredentials: true | ||
- script: | | ||
# Translate back env vars to avoid cyclical reference :/ | ||
export aws_access_key_id=$var_aws_access_key_id | ||
export aws_secret_access_key=$var_aws_secret_access_key | ||
|
||
echo "[TEST] executing ROR_TASK = $ROR_TASK" | ||
ci/run-pipeline.sh | ||
env: | ||
var_aws_access_key_id: $(aws_access_key_id) | ||
var_aws_secret_access_key: $(aws_secret_access_key) | ||
- task: PublishTestResults@2 | ||
condition: failed() | ||
inputs: | ||
testRunTitle: "$(ROR_TASK) results" | ||
testResultsFiles: "**/TEST*xml" | ||
mergeTestResults: true | ||
strategy: | ||
maxParallel: 99 | ||
matrix: | ||
IT_es818x: | ||
ROR_TASK: integration_es818x | ||
IT_es810x: | ||
ROR_TASK: integration_es810x | ||
IT_es80x: | ||
ROR_TASK: integration_es80x | ||
- job: | ||
condition: and(succeeded(), or(eq(variables.isEpic, true), eq(variables.isDevelop, true), eq(variables.isMaster, true))) | ||
timeoutInMinutes: 120 | ||
steps: | ||
- checkout: self | ||
fetchDepth: 1 | ||
clean: false | ||
persistCredentials: true | ||
- script: | | ||
# Translate back env vars to avoid cyclical reference :/ | ||
export aws_access_key_id=$var_aws_access_key_id | ||
export aws_secret_access_key=$var_aws_secret_access_key | ||
|
||
echo "[TEST] executing ROR_TASK = $ROR_TASK" | ||
ci/run-pipeline.sh | ||
env: | ||
var_aws_access_key_id: $(aws_access_key_id) | ||
var_aws_secret_access_key: $(aws_secret_access_key) | ||
versionSpec: '21' | ||
jdkArchitectureOption: 'x64' | ||
jdkSourceOption: 'PreInstalled' | ||
- powershell: | |
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.
💡 Verification agent
❓ Verification inconclusive
Verify Java 21 availability on the agent
The JavaToolInstaller@0
step is configured for Java 21 (versionSpec: '21'
). Ensure that the windows-2022
hosted agent actually provides JDK 21, or add a fallback installation if needed.
🏁 Script executed:
#!/bin/bash
# Check available Java installations on the agent (run in a debug pipeline or local Windows VM)
java -version
Length of output: 194
Install Java 21 via JDKDownload
The windows-2022
hosted agent only ships with OpenJDK 17 by default. Using jdkSourceOption: 'PreInstalled'
for version 21 will fail. Switch to JDKDownload
and choose a distribution (e.g. Temurin) to ensure JDK 21 is installed:
File: azure-pipelines.yml (lines 56–62)
- task: JavaToolInstaller@0
- displayName: Switch to Java 21
- inputs:
- versionSpec: '21'
- jdkArchitectureOption: 'x64'
- jdkSourceOption: 'PreInstalled'
+ task: JavaToolInstaller@0
+ displayName: Switch to Java 21
+ inputs:
+ versionSpec: '21'
+ jdkArchitectureOption: 'x64'
+ jdkSourceOption: 'JDKDownload'
+ jdkDistributionOption: 'Temurin'
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
- task: JavaToolInstaller@0 | |
displayName: Switch to Java 21 | |
inputs: | |
testRunTitle: "$(ROR_TASK) results" | |
testResultsFiles: "**/TEST*xml" | |
mergeTestResults: true | |
strategy: | |
maxParallel: 99 | |
matrix: | |
IT_es90x: | |
ROR_TASK: integration_es90x | |
- job: | |
condition: and(succeeded(), ne(variables.isEpic, true), ne(variables.isDevelop, true), ne(variables.isMaster, true)) | |
container: openjdk:22-slim | |
timeoutInMinutes: 120 | |
steps: | |
- checkout: self | |
fetchDepth: 1 | |
clean: false | |
persistCredentials: true | |
- script: | | |
# Translate back env vars to avoid cyclical reference :/ | |
export aws_access_key_id=$var_aws_access_key_id | |
export aws_secret_access_key=$var_aws_secret_access_key | |
echo "[TEST] executing ROR_TASK = $ROR_TASK" | |
ci/run-pipeline.sh | |
env: | |
var_aws_access_key_id: $(aws_access_key_id) | |
var_aws_secret_access_key: $(aws_secret_access_key) | |
- task: PublishTestResults@2 | |
condition: failed() | |
inputs: | |
testRunTitle: "$(ROR_TASK) results" | |
testResultsFiles: "**/TEST*xml" | |
mergeTestResults: true | |
strategy: | |
maxParallel: 99 | |
matrix: | |
IT_es818x: | |
ROR_TASK: integration_es818x | |
IT_es810x: | |
ROR_TASK: integration_es810x | |
IT_es80x: | |
ROR_TASK: integration_es80x | |
- job: | |
condition: and(succeeded(), or(eq(variables.isEpic, true), eq(variables.isDevelop, true), eq(variables.isMaster, true))) | |
timeoutInMinutes: 120 | |
steps: | |
- checkout: self | |
fetchDepth: 1 | |
clean: false | |
persistCredentials: true | |
- script: | | |
# Translate back env vars to avoid cyclical reference :/ | |
export aws_access_key_id=$var_aws_access_key_id | |
export aws_secret_access_key=$var_aws_secret_access_key | |
echo "[TEST] executing ROR_TASK = $ROR_TASK" | |
ci/run-pipeline.sh | |
env: | |
var_aws_access_key_id: $(aws_access_key_id) | |
var_aws_secret_access_key: $(aws_secret_access_key) | |
versionSpec: '21' | |
jdkArchitectureOption: 'x64' | |
jdkSourceOption: 'PreInstalled' | |
- powershell: | | |
- task: JavaToolInstaller@0 | |
displayName: Switch to Java 21 | |
inputs: | |
versionSpec: '21' | |
jdkArchitectureOption: 'x64' | |
jdkSourceOption: 'JDKDownload' | |
jdkDistributionOption: 'Temurin' | |
- powershell: | |
🤖 Prompt for AI Agents
In azure-pipelines.yml around lines 56 to 62, the JavaToolInstaller task is set
to use Java 21 with jdkSourceOption as 'PreInstalled', but the windows-2022
agent only has Java 17 preinstalled. Change jdkSourceOption to 'JDKDownload' and
specify a JDK distribution like Temurin to ensure Java 21 is downloaded and
installed during the pipeline run.
Summary by CodeRabbit