Skip to content

Commit d03d201

Browse files
committed
Decouple test JDK and gradle JDK in testng latestDepTest
1 parent f1d359b commit d03d201

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

dd-java-agent/instrumentation/testng/testng-7/build.gradle

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@ plugins {
22
id 'java-test-fixtures'
33
}
44

5+
ext {
6+
// testng 7.6.0+ requires Java 11 or higher.
7+
latestDepTestMinJavaVersionForTests = JavaVersion.VERSION_11
8+
}
9+
510
apply from: "$rootDir/gradle/java.gradle"
611

712
muzzle {
@@ -21,6 +26,8 @@ muzzle {
2126
}
2227

2328
addTestSuiteForDir('latestDepTest', 'test')
29+
// testng 7.5.1 is the latest version compatible with Java 8
30+
addTestSuiteForDir('testng751Test', 'test')
2431

2532
dependencies {
2633
compileOnly group: 'org.testng', name: 'testng', version: '7.0.0'
@@ -29,7 +36,7 @@ dependencies {
2936

3037
testImplementation testFixtures(project(':dd-java-agent:instrumentation:testng'))
3138
testImplementation group: 'org.testng', name: 'testng', version: '7.0.0'
32-
39+
testng751TestImplementation group: 'org.testng', name: 'testng', version: '7.5.1'
3340
latestDepTestImplementation group: 'org.testng', name: 'testng', version: '+'
3441
}
3542

@@ -41,9 +48,3 @@ configurations.matching({ it.name.startsWith('test') }).each({
4148
}
4249
})
4350

44-
configurations.matching({ it.name.startsWith('latestDepTest') }).each({
45-
it.resolutionStrategy {
46-
// TestNG 7.6+ is compiled with Java 11
47-
force group: 'org.testng', name: 'testng', version: (JavaVersion.current().java11Compatible ? '+' : '7.5')
48-
}
49-
})

0 commit comments

Comments
 (0)