Skip to content

test: fix test_java and mark as slow#8634

Merged
jdx merged 2 commits intojdx:mainfrom
roele:issues/fix-java-test
Mar 19, 2026
Merged

test: fix test_java and mark as slow#8634
jdx merged 2 commits intojdx:mainfrom
roele:issues/fix-java-test

Conversation

@roele
Copy link
Copy Markdown
Contributor

@roele roele commented Mar 17, 2026

Test started failing since latest Java EA version is now 27 not 26

Copilot AI review requested due to automatic review settings March 17, 2026 19:22
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request resolves a failing end-to-end test by updating the expected Java Early Access version from 26 to 27, aligning with the latest available release. Additionally, the test file has been renamed to indicate its slow execution time, which helps in better test suite management.

Highlights

  • Java EA Version Update: The test now installs and verifies Java Early Access version 27, as version 26 is no longer the latest EA release, resolving recent test failures.
  • Test File Renaming: The e2e/core/test_java file has been renamed to e2e/core/test_java_slow to explicitly mark it as a slow-running test.
Changelog
  • e2e/core/test_java_slow
    • Updated the Java Early Access version from 26 to 27 in the installation and verification commands.
    • Renamed the test file from e2e/core/test_java to e2e/core/test_java_slow.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Mar 17, 2026

Greptile Summary

This PR fixes a flaky test by replacing the hardcoded Java EA version (openjdk-26.0.0-ea) with dynamic detection from https://jdk.java.net, and renames the file to test_java_slow to signal it is a slow-running test.

  • e2e/core/test_java is deleted; its contents are migrated to e2e/core/test_java_slow
  • The EA major version is now scraped from jdk.java.net at runtime, with a sensible fallback of 27 when the request fails
  • The version-assertion string is updated accordingly to use the dynamically resolved ${EA_MAJOR}
  • One minor portability issue: the first grep in the pipeline uses BRE \+ (a GNU extension) instead of -E with +, which would silently produce an empty match on macOS, causing the test to always use the fallback value rather than the live version

Confidence Score: 4/5

  • Safe to merge — the change correctly fixes the immediate breakage and is an improvement over the hardcoded version, with one small portability nit
  • The core logic is sound: scraping the EA version at runtime and falling back to a hardcoded default is a good pattern. The only notable issue is the BRE \+ portability in the grep chain, which is a minor style concern that would cause silent fallback to the hardcoded value on macOS rather than any functional failure.
  • e2e/core/test_java_slow — specifically line 21 and the grep regex portability

Important Files Changed

Filename Overview
e2e/core/test_java Deleted — contents migrated to test_java_slow with the EA version hardcode removed
e2e/core/test_java_slow Replaces test_java with dynamic EA version detection from jdk.java.net; minor portability issue with BRE \+ in the first grep call that would silently fail on macOS, always falling back to the hardcoded value

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[test_java_slow starts] --> B[Set idiomatic_version_file_enable_tools]
    B --> C[Write .sdkmanrc with java=17.0.2]
    C --> D[mise i java]
    D --> E{assert: java -version == 17.0.2}
    E --> F[rm .sdkmanrc]
    F --> G[Write .java-version with 17.0.2]
    G --> H{assert: java -version == 17.0.2}
    H --> I[rm .java-version]
    I --> J[curl jdk.java.net]
    J --> K{Parse EA major version}
    K -- success --> L[EA_MAJOR = parsed value]
    K -- failure / empty --> M[EA_MAJOR = 27 fallback]
    L --> N[mise i java EA version]
    M --> N
    N --> O{assert: java -version == EA-ea}
Loading

Last reviewed commit: 247ac7d

Comment thread e2e/core/test_java_slow Outdated
@roele roele force-pushed the issues/fix-java-test branch from aefb157 to a224f7d Compare March 17, 2026 19:25
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the Java E2E test that installs an OpenJDK early-access build so it keeps passing now that the latest EA major version has moved from 26 to 27.

Changes:

  • Bump the EA install target in the Java slow E2E test from openjdk-26.0.0-ea to openjdk-27.0.0-ea
  • Update the expected java -version output from 26-ea to 27-ea
Comments suppressed due to low confidence (1)

e2e/core/test_java_slow:21

  • The comment says this is testing the EA version of Java 26, but the test now installs OpenJDK 27 EA. Please update the comment to match the actual version under test to avoid confusion when this fails again in the future.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates a test to use the latest Java Early Access version, fixing a failing test case. The change is correct, but I've added a couple of suggestions to improve the long-term maintainability of this test. Specifically, I've pointed out an outdated comment and the brittle nature of hardcoding versions that change over time.

Comment thread e2e/core/test_java_slow
Comment thread e2e/core/test_java_slow Outdated
@roele roele force-pushed the issues/fix-java-test branch from a224f7d to a7c5381 Compare March 17, 2026 19:56
@jdx jdx merged commit 08b98fb into jdx:main Mar 19, 2026
33 of 34 checks passed
@roele roele deleted the issues/fix-java-test branch March 20, 2026 17:02
jdx pushed a commit that referenced this pull request Mar 21, 2026
### 🐛 Bug Fixes

- **(config)** resolve trust hash collision for same-name directories by
@tdragon in [#8628](#8628)
- **(docs)** fix width of tools table by @himkt in
[#8625](#8625)
- **(docs)** prevent homepage hero atmosphere overflow by @nygmaaa in
[#8642](#8642)
- **(doctor)** detect PATH ordering issues when mise is activated by
@jdx in [#8585](#8585)
- **(git)** use origin as remote name by @bentinata in
[#8626](#8626)
- **(installer)** normalize current version before comparison by @tak848
in [#8649](#8649)
- **(lockfile)** Resolve symlink when updating lockfiles by @chancez in
[#8589](#8589)
- **(python)** verify checksums for precompiled binary downloads by
@malept in [#8593](#8593)
- **(rust)** resolve relative CARGO_HOME/RUSTUP_HOME to absolute paths
by @simonepri in [#8604](#8604)
- **(task)** correctly resolve task name for _default files with
extensions by @youta1119 in
[#8646](#8646)
- **(tasks)** global file tasks not properly marked as such by @roele in
[#8618](#8618)
- **(tasks)** handle broken pipe in table print and task completion
output by @vmaleze in [#8608](#8608)
- use dark/light logo variants in README for GitHub dark mode by @jdx in
[#8656](#8656)
- failing rebuild of runtime symlinks for shared tools by @roele in
[#8647](#8647)
- add spaces around current element operator in flutter version_expr by
@roele in [#8616](#8616)
- complete task arguments correctly by @KevSlashNull in
[#8601](#8601)

### 📚 Documentation

- switch body font to DM Sans and darken dark mode background by @jdx in
[6e3ad34](6e3ad34)
- use Cormorant Garamond for headers and Roc Grotesk for body text by
@jdx in
[010812a](010812a)
- resolve chaotic heading hierarchy in task-arguments.md by @muzimuzhi
in [#8644](#8644)

### 🧪 Testing

- fix test_java and mark as slow by @roele in
[#8634](#8634)

### 📦️ Dependency Updates

- update docker/dockerfile:1 docker digest to 4a43a54 by @renovate[bot]
in [#8657](#8657)
- update ghcr.io/jdx/mise:alpine docker digest to 2584470 by
@renovate[bot] in [#8658](#8658)

### 📦 Registry

- add viteplus (npm:vite-plus) by @risu729 in
[#8594](#8594)
- remove backend.options for podman by @roele in
[#8633](#8633)
- add pi.dev coding agent by @dector in
[#8635](#8635)
- add ormolu ([github:tweag/ormolu](https://github.com/tweag/ormolu)) by
@3w36zj6 in [#8617](#8617)
- use version_expr for dart and sort versions by @roele in
[#8631](#8631)

### New Contributors

- @bentinata made their first contribution in
[#8626](#8626)
- @tdragon made their first contribution in
[#8628](#8628)
- @nygmaaa made their first contribution in
[#8642](#8642)
- @youta1119 made their first contribution in
[#8646](#8646)
- @chancez made their first contribution in
[#8589](#8589)
- @dector made their first contribution in
[#8635](#8635)
- @tak848 made their first contribution in
[#8649](#8649)

## 📦 Aqua Registry Updates

#### New Packages (5)

- [`acsandmann/rift`](https://github.com/acsandmann/rift)
-
[`alltuner/mise-completions-sync`](https://github.com/alltuner/mise-completions-sync)
- [`berbicanes/apiark`](https://github.com/berbicanes/apiark)
-
[`gitlab.com/graphviz/graphviz`](https://github.com/gitlab.com/graphviz/graphviz)
-
[`jorgelbg/pinentry-touchid`](https://github.com/jorgelbg/pinentry-touchid)

#### Updated Packages (7)

- [`UpCloudLtd/upcloud-cli`](https://github.com/UpCloudLtd/upcloud-cli)
- [`aquaproj/registry-tool`](https://github.com/aquaproj/registry-tool)
- [`go-swagger/go-swagger`](https://github.com/go-swagger/go-swagger)
-
[`gopinath-langote/1build`](https://github.com/gopinath-langote/1build)
- [`sassman/t-rec-rs`](https://github.com/sassman/t-rec-rs)
- [`sharkdp/fd`](https://github.com/sharkdp/fd)
- [`temporalio/cli`](https://github.com/temporalio/cli)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants