Skip to content

Commit 4d1a38c

Browse files
authored
Add JDK 26-EA testing to CI (#9996)
* Add Java 26 to CI as non-default JVM * Add EA workarounds * Update gradle compatibility check * Skip maven smoke tests * Use @EnabledForJreRange instead of workaround * Oops use annotation correctly now
1 parent 09eedf1 commit 4d1a38c

File tree

5 files changed

+20
-2
lines changed

5 files changed

+20
-2
lines changed

.gitlab-ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ workflow:
6161
- "17"
6262
- "21"
6363
- "25"
64+
- "26"
6465
- "semeru11"
6566
- "oracle8"
6667
- "zulu8"

buildSrc/src/main/kotlin/datadog/gradle/plugin/testJvmConstraints/TestJvmSpec.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ class TestJvmSpec(val project: Project) {
5656
"stable" -> {
5757
val javaVersions = project.providers.environmentVariablesPrefixedBy("JAVA_").map { javaHomes ->
5858
javaHomes
59-
.filter { it.key.matches(Regex("^JAVA_[0-9]+_HOME$")) }
59+
.filter { it.key.matches(Regex("^JAVA_[0-9]+_HOME$")) && it.key != "JAVA_26_HOME" } // JDK 26 is EA
6060
.map { Regex("^JAVA_(\\d+)_HOME$").find(it.key)!!.groupValues[1].toInt() }
6161
}.get()
6262

dd-java-agent/agent-debugger/src/test/java/com/datadog/debugger/agent/CapturedSnapshotTest.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -642,6 +642,8 @@ public void sourceFileProbeGroovy() throws IOException, URISyntaxException {
642642
}
643643

644644
@Test
645+
@EnabledForJreRange(
646+
max = JRE.JAVA_25) // TODO: Fix for Java 26. Delete once Java 26 is officially released.
645647
@DisabledIf(
646648
value = "datadog.environment.JavaVirtualMachine#isJ9",
647649
disabledReason = "Issue with J9 when compiling Kotlin code")
@@ -674,6 +676,8 @@ public void sourceFileProbeKotlin() throws IOException, URISyntaxException {
674676
}
675677

676678
@Test
679+
@EnabledForJreRange(
680+
max = JRE.JAVA_25) // TODO: Fix for Java 26. Delete once Java 26 is officially released.
677681
@DisabledIf(
678682
value = "datadog.environment.JavaVirtualMachine#isJ9",
679683
disabledReason = "Issue with J9 when compiling Kotlin code")
@@ -701,6 +705,8 @@ public void suspendKotlin() throws IOException, URISyntaxException {
701705
}
702706

703707
@Test
708+
@EnabledForJreRange(
709+
max = JRE.JAVA_25) // TODO: Fix for Java 26. Delete once Java 26 is officially released.
704710
@DisabledIf(
705711
value = "datadog.environment.JavaVirtualMachine#isJ9",
706712
disabledReason = "Issue with J9 when compiling Kotlin code")
@@ -734,6 +740,8 @@ public void suspendMethodKotlin() {
734740
}
735741

736742
@Test
743+
@EnabledForJreRange(
744+
max = JRE.JAVA_25) // TODO: Fix for Java 26. Delete once Java 26 is officially released.
737745
@DisabledIf(
738746
value = "datadog.environment.JavaVirtualMachine#isJ9",
739747
disabledReason = "Issue with J9 when compiling Kotlin code")

dd-smoke-tests/gradle/src/test/groovy/datadog/smoketest/AbstractGradleTest.groovy

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,11 @@ class AbstractGradleTest extends CiVisibilitySmokeTest {
9393

9494
private static boolean isSupported(ComparableVersion gradleVersion) {
9595
// https://docs.gradle.org/current/userguide/compatibility.html
96-
if (Jvm.current.isJavaVersionCompatible(25)) {
96+
if (Jvm.current.isJavaVersionCompatible(26)) {
97+
// TODO: Fix for Java 26. Check compatibility doc / issue to confirm the minimum version.
98+
// https://github.com/gradle/gradle/issues/35406
99+
return gradleVersion.compareTo(new ComparableVersion("9.4")) >= 0
100+
} else if (Jvm.current.isJavaVersionCompatible(25)) {
97101
return gradleVersion.compareTo(new ComparableVersion("9.1")) >= 0
98102
} else if (Jvm.current.isJavaVersionCompatible(24)) {
99103
return gradleVersion.compareTo(new ComparableVersion("8.14")) >= 0

dd-smoke-tests/maven/src/test/groovy/datadog/smoketest/MavenSmokeTest.groovy

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package datadog.smoketest
22

3+
import datadog.environment.JavaVirtualMachine
34
import datadog.trace.api.civisibility.CIConstants
45
import datadog.trace.api.config.CiVisibilityConfig
56
import datadog.trace.api.config.GeneralConfig
@@ -13,6 +14,7 @@ import org.slf4j.LoggerFactory
1314
import org.w3c.dom.Document
1415
import org.w3c.dom.NodeList
1516
import spock.lang.AutoCleanup
17+
import spock.lang.IgnoreIf
1618
import spock.lang.Shared
1719
import spock.lang.TempDir
1820
import spock.util.environment.Jvm
@@ -30,6 +32,9 @@ import java.util.concurrent.TimeoutException
3032

3133
import static org.junit.jupiter.api.Assumptions.assumeTrue
3234

35+
@IgnoreIf(reason = "TODO: Fix for Java 26. Maven compiler fails to compile the tests for Java 26-ea.", value = {
36+
JavaVirtualMachine.isJavaVersionAtLeast(26)
37+
})
3338
class MavenSmokeTest extends CiVisibilitySmokeTest {
3439

3540
private static final Logger LOGGER = LoggerFactory.getLogger(MavenSmokeTest)

0 commit comments

Comments
 (0)