Skip to content

Run tests on matrix JDK via Gradle toolchains while keeping daemon on JDK 21#155

Draft
wmdietl with Copilot wants to merge 4 commits into
masterfrom
copilot/sub-pr-154
Draft

Run tests on matrix JDK via Gradle toolchains while keeping daemon on JDK 21#155
wmdietl with Copilot wants to merge 4 commits into
masterfrom
copilot/sub-pr-154

Conversation

Copilot AI commented Mar 7, 2026

Copy link
Copy Markdown

Each CI matrix entry was silently running tests on JDK 21 regardless of matrix.java, because org.gradle.java.home forced the Gradle daemon (and thus test execution) onto JDK 21. Tests now actually run on the matrix JDK using Test.javaLauncher.

Changes

  • build.gradle: Configures javaLauncher on the test task via Gradle toolchains when the testJavaVersion property is set, decoupling the test JVM from the Gradle daemon JVM:
    if (project.hasProperty('testJavaVersion')) {
        javaLauncher = javaToolchains.launcherFor {
            languageVersion = JavaLanguageVersion.of(project.property('testJavaVersion') as Integer)
        }
    }
  • .github/workflows/gradle.yml: Passes -PtestJavaVersion=${{ matrix.java }} to both ./gradlew build invocations so each matrix entry (11, 17, 21, 25) exercises the corresponding JDK runtime. Gradle daemon remains on JDK 21 via org.gradle.java.home.

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Base automatically changed from jdk11 to master March 7, 2026 22:53
Co-authored-by: wmdietl <6699136+wmdietl@users.noreply.github.com>
Copilot AI changed the title [WIP] Address feedback on adding Java 11 to Gradle workflow matrix Run tests on matrix JDK via Gradle toolchains while keeping daemon on JDK 21 Mar 7, 2026
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.

2 participants