Skip to content

Run the tests on JDK 25, 26 and 27 as well - #29

Closed
abashev wants to merge 1 commit into
mainfrom
jdk-matrix
Closed

abashev wants to merge 1 commit into
mainfrom
jdk-matrix

Conversation

@abashev

@abashev abashev commented Sep 22, 2026

Copy link
Copy Markdown
Collaborator

The formatter parses with the javac of the JDK it runs on, so a change can pass on 21 and break on a newer JDK. This adds a jdk job that runs the tests of build on JDK 25, 26 and 27.

  • Parallel and independent. The three legs run next to build and native, with fail-fast: false. Nothing waits for them, and nothing they build is kept.
  • What moves. -PjavaRuntime sets baseline's javaVersions.runtime, which changes only the JVMs the tests run on, and with them javac's internals. The code is still compiled for Java 21 by JDK 21, as in the release. The IntelliJ plugin's tests stay on the JetBrains Runtime of the IDE they start.
  • build is unchanged. It still runs on JDK 21 and keeps its name, because the ruleset on main requires a check called build. The native jobs still wait for it.
  • Finding the JDK. Gradle does not look in the runner's tool cache, so each leg passes its JDK with -Porg.gradle.java.installations.paths.

Tested locally:

  • ./gradlew test -PjavaRuntime=25 passes: 1410 formatter tests, 22 Gradle plugin tests and 9 IntelliJ plugin tests.
  • With auto-detection off and only an explicit JDK 25 path, the Gradle plugin's tests ran on that JDK. So -Porg.gradle.java.installations.paths is honoured on the command line.
  • Without the property, the tests still run on JDK 21.

JDK 26 and 27 are tried only here in CI. Gradle 9.7.1 officially supports Java up to 26, and the Gradle plugin's TestKit builds run Gradle on the test JVM.

The formatter parses with the javac of the JDK it runs on, so a change can pass
on 21 and break on a newer JDK. A new `jdk` job runs the tests of `build` on
25, 26 and 27, in parallel with the other jobs; nothing waits for it.

-PjavaRuntime sets baseline's javaVersions.runtime, which moves only the test
JVMs: the code is still compiled for Java 21 by JDK 21. The IntelliJ plugin's
tests keep the runtime of the IDE they start. `build` keeps JDK 21 and its
name, which the ruleset on main requires.
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.

1 participant