Merge pull request #1331 from DataDog/mar-kolya/run-profiling-tests-on-zulu8

Run profiling tests on zulu8
This commit is contained in:
Nikolay Martynov 2020-03-23 08:54:21 -04:00 committed by GitHub
commit 461f226a0c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 6 deletions

View File

@ -1,6 +1,11 @@
// Set properties before any plugins get loaded // Set properties before any plugins get loaded
ext { ext {
minJavaVersionForTests = JavaVersion.VERSION_11 minJavaVersionForTests = JavaVersion.VERSION_11
// Zulu has backported profiling support
forceJdk = ['ZULU8']
// By default tests with be compiled for `minJavaVersionForTests` version,
// but in this case we would like to avoid this since we would like to run with ZULU8
skipSettingTestJavaVersion = true
} }
apply from: "${rootDir}/gradle/java.gradle" apply from: "${rootDir}/gradle/java.gradle"
@ -26,7 +31,6 @@ Setup here is as following:
* We compile with Java11 compiler to get JFR definitions. * We compile with Java11 compiler to get JFR definitions.
* We specify source/target as Java8 to get code that is loadable on Java8 - JFR defs are Java8 compatible. * We specify source/target as Java8 to get code that is loadable on Java8 - JFR defs are Java8 compatible.
* We force IDEA to treat this as Java11 project with 'idea' plugin below. * We force IDEA to treat this as Java11 project with 'idea' plugin below.
* We run tests only on Java11+.
*/ */
sourceCompatibility = JavaVersion.VERSION_1_8 sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8 targetCompatibility = JavaVersion.VERSION_1_8

View File

@ -5,7 +5,7 @@ plugins {
ext { ext {
minJavaVersionForTests = JavaVersion.VERSION_11 minJavaVersionForTests = JavaVersion.VERSION_11
// Zulu has backported profiling support // Zulu has backported profiling support
forceJdk = ['ZULU8', 'ZULU11', '12'] forceJdk = ['ZULU8']
jmcVersion = '8.0.0-SNAPSHOT' jmcVersion = '8.0.0-SNAPSHOT'
} }

View File

@ -48,10 +48,15 @@ if (project.hasProperty('minJavaVersionForTests') && project.getProperty('minJav
from sourceSets."main_$name".output from sourceSets."main_$name".output
} }
tasks.withType(JavaCompile).configureEach { // In some cases we would like to avoid setting java version to `minJavaVersionForTests`.
if (it.name.toLowerCase().contains("test")) { // For example we would like to be able to run profiling tests with ZULU8, but we cannot run it with other JDK8 implementations at the moment
sourceCompatibility = version def skipSettingTestJavaVersion = project.hasProperty('skipSettingTestJavaVersion') && project.getProperty('skipSettingTestJavaVersion')
targetCompatibility = version if (!skipSettingTestJavaVersion) {
tasks.withType(JavaCompile).configureEach {
if (it.name.toLowerCase().contains("test")) {
sourceCompatibility = version
targetCompatibility = version
}
} }
} }
} }