Skip to content

Commit bf3b185

Browse files
jbachorikclaude
andcommitted
fix(ci): downgrade junit-jupiter for btrace-core's pre-17 V2 protocol test runs
v2-protocol-tests.yml compiles/runs :btrace-core:test against JDK 8/11/17/21 toolchains via -PtestJavaVersion, added because Gradle itself needs JVM 17+ but the wire protocol still needs verifying on older JDKs. junit-jupiter 6.x requires JDK 17+ to resolve against, so the JDK 11 leg failed at compileTestJava. btrace-agent hit the same issue and fixed it by forcing junit-jupiter to 5.14.4, but btrace-core also imports the JUnit BOM (platform(libs.junit)), which re-pins every org.junit.jupiter/org.junit.platform artifact — including transitive ones like junit-platform-commons — back to 6.x, so forcing just the aggregator coordinate wasn't enough here. Use an eachDependency rule to downgrade the whole junit-jupiter/junit-platform family when testJavaVersion < 17. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
1 parent 3e1dd34 commit bf3b185

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

btrace-core/build.gradle

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,24 @@ if (testJavaVersion) {
7373
languageVersion = JavaLanguageVersion.of(testJavaVersion as int)
7474
}
7575
}
76+
if ((testJavaVersion as int) < 17) {
77+
// junit-jupiter 6.x requires JDK 17+ to resolve/compile against; downgrade to the
78+
// last JDK 8-compatible release for pre-17 toolchain runs. The testImplementation
79+
// platform(libs.junit) BOM above pins every org.junit.jupiter/org.junit.platform
80+
// artifact (including transitive ones like junit-platform-commons) to 6.x, so a
81+
// blanket eachDependency rule is needed rather than forcing individual coordinates.
82+
def downgradeJunit5 = {
83+
resolutionStrategy.eachDependency { details ->
84+
if (details.requested.group == 'org.junit.jupiter') {
85+
details.useVersion '5.14.4'
86+
} else if (details.requested.group == 'org.junit.platform') {
87+
details.useVersion '1.14.4'
88+
}
89+
}
90+
}
91+
configurations.testCompileClasspath(downgradeJunit5)
92+
configurations.testRuntimeClasspath(downgradeJunit5)
93+
}
7694
}
7795

7896
test {

0 commit comments

Comments
 (0)