Implement Dependabot findings: JUnit 6.1.3, Groovy 5.1.0, nativeimage 25.2.4, android-emulator-runner 2.38.0 - #2960
Conversation
… 25.2.4, android-emulator-runner 2.38.0 Implements the four open Dependabot findings for jMonkeyEngine#2958, plus the minimum build fallout they cause. ## Dependency updates | Finding | File | Change | | --- | --- | --- | | jMonkeyEngine#2955 | `gradle/libs.versions.toml` | `org.junit:junit-bom` 5.13.4 → 6.1.3 | | jMonkeyEngine#2955 | `jme3-screenshot-tests-shared/build.gradle`, `jme3-screenshot-tests-desktop/build.gradle` | hardcoded `org.junit:junit-bom` / `useJUnitJupiter` 5.9.1 → 6.1.3 (all JUnit usages now resolve to one version) | | jMonkeyEngine#2956 | `gradle/libs.versions.toml` | `org.apache.groovy:groovy-test` 4.0.31 → 5.1.0 | | jMonkeyEngine#2957 | `jme3-nativeimage-plugin/build.gradle` | `org.graalvm.sdk:nativeimage` 25.0.3 → 25.2.4 (`org.graalvm.nativeimage:svm` deliberately left at 25.0.3, as in the Dependabot PR) | | jMonkeyEngine#2933 | `.github/workflows/android-screenshot.yml` | `reactivecircus/android-emulator-runner` v2.37.0 → v2.38.0 | ## Required fallout fixes **`jme3-core/src/test/groovy/com/jme3/app/state/AppStateManagerTest.groovy`** — migrated from the JUnit-3-based `groovy.test.GroovyTestCase` (removed in Groovy 5) to JUnit 5 Jupiter. The old file also could never run: its test classes were nested `static` classes extending `GroovyTestCase`, which `useJUnitPlatform()` does not discover. All 8 original cases and assertions are preserved (group names carried into the method names); `shouldFail(IllegalArgumentException) {}` became `assertThrows(IllegalArgumentException, { … } as Executable)` and the assertion helpers are statically imported, matching the style of the Java test sources. **`common.gradle`** — JUnit 6 is compiled for Java 17, while every `JavaCompile` task in this build uses `options.release = 8`, so javac rejects the JUnit 6 jars. `options.release` is now raised to 17 for test compilation (all modules) and for the main compilation of the `:jme3-screenshot-tests:*` framework modules, whose main sources use JUnit (e.g. `ScreenshotTest.java` imports `org.junit.jupiter.api.Assertions.fail`). The engine itself still targets Java 8. No other dependency was touched. ## Validation status (read before approving) Performed in the sandbox on a clean checkout of the patch: * `gradle/libs.versions.toml` parses; `junit-bom = …6.1.3`, `groovy-test = …5.1.0`. * `.github/workflows/android-screenshot.yml` parses as YAML; runner pinned at `@v2.38.0`. * version audit: no `junit-bom:5*`, `groovy-test:4*`, `nativeimage:25.0.3` (only `svm:25.0.3` remains), `emulator-runner@v2.37.0` or `5.9.1` anywhere in the touched files. * `AppStateManagerTest.groovy`: no `GroovyTestCase` reference left in the repo, 8 `@Test` methods, 4 `assertThrows` uses. * evidence for the release-17 rule: the shared screenshot-test module's **main** sources import `org.junit`. **Not performed here:** compiling and running the test suite. This sandbox has no route to `services.gradle.org` (the Gradle wrapper distribution download fails) and no Android SDK, so `./gradlew` cannot run at all — neither `:jme3-core:test` nor the isolated `jme3-nativeimage-plugin` compile against nativeimage 25.2.4 could be executed. Nothing in this description should be read as a passing build. So CI must be the gate for this PR (`BuildJMonkey`, `Checkstyle`, `ScreenshotTests`, `android-screenshot`), and a local `./gradlew :jme3-core:test` is the fastest pre-merge confirmation. Known residual risks to watch in CI: 1. `compileTestJava`/`compileJava` now use `--release 17`; if the release-17 override does not win over the shared `options.release = 8` block, javac will report "class file has wrong version 61.0" for the JUnit 6 jars — that is the exact symptom to look for. 2. `mockito-junit-jupiter` 5.23.0 was intentionally **not** bumped; if its Jupiter extension does not accept JUnit 6 at runtime, the affected tests will fail with an API/`NoSuchMethodError` and Mockito would need a companion bump (reported here rather than worked around). 3. The Android app module dexes JUnit 6 (Java 17 class files) transitively through the shared module; AGP 9.1 should accept that, but it can only be confirmed by the Android build.
|
@jaime-jmebot the CI fails, fix this PR |
|
Confirmed from CI run 35197961153 and 35197961087. Root cause is not the Failing jobs
Passing: Next step: JUnit 6 must not reach |
The shared framework's JUnit Jupiter dependency is now compileOnly, so JUnit 6.1.3 no longer reaches the Android app's runtime classpath (D8 record-desugaring failure at mergeExtDexDebug).
|
Fixed in 952cd4b. Change ( compileOnly platform('org.junit:junit-bom:6.1.3')
compileOnly 'org.junit.jupiter:junit-jupiter'
testImplementation platform('org.junit:junit-bom:6.1.3')
testImplementation 'org.junit.jupiter:junit-jupiter'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'JUnit Jupiter is no longer an Why Validation run in the sandbox (4 commands): the compile-only/test wiring in |
|
@jaime-jmebot android CI is still failing |
|
Checked the run for the current head ( What is fixed on this head
What still fails
What I need
|
Tracks #2958
Implementation plan
Progress summary
Apply the four open Dependabot dependency updates in jMonkeyEngine/jmonkeyengine and fix the build fallout, without touching unrelated dependencies (in particular do NOT change org.graalvm.nativeimage:svm, mockito, or any engine version).
Tests
7 approved test command(s) completed successfully in the sandbox
Result
Implements the four open Dependabot findings for #2958, plus the minimum build fallout they cause.
Dependency updates
gradle/libs.versions.tomlorg.junit:junit-bom5.13.4 → 6.1.3jme3-screenshot-tests-shared/build.gradle,jme3-screenshot-tests-desktop/build.gradleorg.junit:junit-bom/useJUnitJupiter5.9.1 → 6.1.3 (all JUnit usages now resolve to one version)gradle/libs.versions.tomlorg.apache.groovy:groovy-test4.0.31 → 5.1.0jme3-nativeimage-plugin/build.gradleorg.graalvm.sdk:nativeimage25.0.3 → 25.2.4 (org.graalvm.nativeimage:svmdeliberately left at 25.0.3, as in the Dependabot PR).github/workflows/android-screenshot.ymlreactivecircus/android-emulator-runnerv2.37.0 → v2.38.0Required fallout fixes
jme3-core/src/test/groovy/com/jme3/app/state/AppStateManagerTest.groovy— migrated from the JUnit-3-basedgroovy.test.GroovyTestCase(removed in Groovy 5) to JUnit 5 Jupiter. The old file also could never run: its test classes were nestedstaticclasses extendingGroovyTestCase, whichuseJUnitPlatform()does not discover. All 8 original cases and assertions are preserved (group names carried into the method names);shouldFail(IllegalArgumentException) {}becameassertThrows(IllegalArgumentException, { … } as Executable)and the assertion helpers are statically imported, matching the style of the Java test sources.common.gradle— JUnit 6 is compiled for Java 17, while everyJavaCompiletask in this build usesoptions.release = 8, so javac rejects the JUnit 6 jars.options.releaseis now raised to 17 for test compilation (all modules) and for the main compilation of the:jme3-screenshot-tests:*framework modules, whose main sources use JUnit (e.g.ScreenshotTest.javaimportsorg.junit.jupiter.api.Assertions.fail). The engine itself still targets Java 8.No other dependency was touched.
Validation status (read before approving)
Performed in the sandbox on a clean checkout of the patch:
gradle/libs.versions.tomlparses;junit-bom = …6.1.3,groovy-test = …5.1.0..github/workflows/android-screenshot.ymlparses as YAML; runner pinned at@v2.38.0.junit-bom:5*,groovy-test:4*,nativeimage:25.0.3(onlysvm:25.0.3remains),emulator-runner@v2.37.0or5.9.1anywhere in the touched files.AppStateManagerTest.groovy: noGroovyTestCasereference left in the repo, 8@Testmethods, 4assertThrowsuses.org.junit.Not performed here: compiling and running the test suite. This sandbox has no route to
services.gradle.org(the Gradle wrapper distribution download fails) and no Android SDK, so./gradlewcannot run at all — neither:jme3-core:testnor the isolatedjme3-nativeimage-plugincompile against nativeimage 25.2.4 could be executed. Nothing in this description should be read as a passing build.So CI must be the gate for this PR (
BuildJMonkey,Checkstyle,ScreenshotTests,android-screenshot), and a local./gradlew :jme3-core:testis the fastest pre-merge confirmation.Known residual risks to watch in CI:
compileTestJava/compileJavanow use--release 17; if the release-17 override does not win over the sharedoptions.release = 8block, javac will report "class file has wrong version 61.0" for the JUnit 6 jars — that is the exact symptom to look for.mockito-junit-jupiter5.23.0 was intentionally not bumped; if its Jupiter extension does not accept JUnit 6 at runtime, the affected tests will fail with an API/NoSuchMethodErrorand Mockito would need a companion bump (reported here rather than worked around).