Merge pull request #973 from DataDog/landerson/all-tests-on-all-jvms

Run all tests on all java versions
This commit is contained in:
Laplie Anderson 2019-09-04 12:28:26 -04:00 committed by GitHub
commit 983b4e2e6c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
13 changed files with 5 additions and 78 deletions

View File

@ -2,12 +2,6 @@ plugins {
id "com.github.johnrengelman.shadow" version "4.0.4" id "com.github.johnrengelman.shadow" version "4.0.4"
} }
// Set properties before any plugins get loaded
project.ext {
// Execute tests on all JVMs, even rare and outdated ones
integrationTests = true
}
description = 'dd-java-agent' description = 'dd-java-agent'
apply from: "${rootDir}/gradle/java.gradle" apply from: "${rootDir}/gradle/java.gradle"

View File

@ -5,13 +5,6 @@
* instrumentation isn't able to reference it. * instrumentation isn't able to reference it.
*/ */
// Set properties before any plugins get loaded
project.ext {
// Execute tests on all JVMs, even rare and outdated ones
coreJavaInstrumentation = true
minJavaVersionForTests = JavaVersion.VERSION_1_7
}
muzzle { muzzle {
pass { pass {
group = "org.hibernate" group = "org.hibernate"

View File

@ -1,10 +1,3 @@
// Set properties before any plugins get loaded
project.ext {
// Execute tests on all JVMs, even rare and outdated ones
coreJavaInstrumentation = true
minJavaVersionForTests = JavaVersion.VERSION_1_7
}
muzzle { muzzle {
pass { pass {
group = "org.hibernate" group = "org.hibernate"

View File

@ -1,10 +1,3 @@
// Set properties before any plugins get loaded
project.ext {
// Execute tests on all JVMs, even rare and outdated ones
coreJavaInstrumentation = true
minJavaVersionForTests = JavaVersion.VERSION_1_7
}
muzzle { muzzle {
pass { pass {
group = "org.hibernate" group = "org.hibernate"

View File

@ -1,9 +1,3 @@
// Set properties before any plugins get loaded
project.ext {
// Execute tests on all JVMs, even rare and outdated ones
coreJavaInstrumentation = true
}
apply from: "${rootDir}/gradle/java.gradle" apply from: "${rootDir}/gradle/java.gradle"
dependencies { dependencies {

View File

@ -1,8 +1,6 @@
// Set properties before any plugins get loaded // Set properties before any plugins get loaded
ext { ext {
minJavaVersionForTests = JavaVersion.VERSION_1_8 minJavaVersionForTests = JavaVersion.VERSION_1_8
// Execute tests on all JVMs, even rare and outdated ones
coreJavaInstrumentation = true
} }
apply from: "${rootDir}/gradle/java.gradle" apply from: "${rootDir}/gradle/java.gradle"

View File

@ -1,9 +1,3 @@
// Set properties before any plugins get loaded
ext {
// Execute tests on all JVMs, even rare and outdated ones
coreJavaInstrumentation = true
}
apply from: "${rootDir}/gradle/java.gradle" apply from: "${rootDir}/gradle/java.gradle"
apply from: "${rootDir}/gradle/test-with-scala.gradle" apply from: "${rootDir}/gradle/test-with-scala.gradle"

View File

@ -1,9 +1,3 @@
// Set properties before any plugins get loaded
project.ext {
// Execute tests on all JVMs, even rare and outdated ones
coreJavaInstrumentation = true
}
apply from: "${rootDir}/gradle/java.gradle" apply from: "${rootDir}/gradle/java.gradle"
apply from: "${rootDir}/gradle/test-with-scala.gradle" apply from: "${rootDir}/gradle/test-with-scala.gradle"
apply from: "${rootDir}/gradle/test-with-kotlin.gradle" apply from: "${rootDir}/gradle/test-with-kotlin.gradle"

View File

@ -1,9 +1,3 @@
// Set properties before any plugins get loaded
project.ext {
// Execute tests on all JVMs, even rare and outdated ones
coreJavaInstrumentation = true
}
apply from: "${rootDir}/gradle/java.gradle" apply from: "${rootDir}/gradle/java.gradle"
apply from: "${rootDir}/gradle/test-with-scala.gradle" apply from: "${rootDir}/gradle/test-with-scala.gradle"

View File

@ -1,9 +1,3 @@
// Set properties before any plugins get loaded
project.ext {
// Execute tests on all JVMs, even rare and outdated ones
coreJavaInstrumentation = true
}
apply from: "${rootDir}/gradle/java.gradle" apply from: "${rootDir}/gradle/java.gradle"
apply plugin: 'org.unbroken-dome.test-sets' apply plugin: 'org.unbroken-dome.test-sets'

View File

@ -346,9 +346,9 @@ class SpanImplTest extends Specification {
def "test JSON rendering with big ID values"() { def "test JSON rendering with big ID values"() {
setup: "create span" setup: "create span"
def parentContext = new SpanContextImpl( def parentContext = new SpanContextImpl(
new BigInteger(2).pow(64).subtract(1).toString(), BigInteger.valueOf(2).pow(64).subtract(1).toString(),
"123", "123",
new BigInteger(2).pow(64).subtract(2).toString()) BigInteger.valueOf(2).pow(64).subtract(2).toString())
def span = new SpanImpl(trace, parentContext, startTimestamp) def span = new SpanImpl(trace, parentContext, startTimestamp)
span.finish() span.finish()

View File

@ -7,6 +7,7 @@ import datadog.trace.tracer.writer.AgentWriter
import datadog.trace.tracer.writer.SampleRateByService import datadog.trace.tracer.writer.SampleRateByService
import datadog.trace.tracer.writer.Writer import datadog.trace.tracer.writer.Writer
import datadog.trace.util.gc.GCUtils import datadog.trace.util.gc.GCUtils
import spock.lang.Requires
import spock.lang.Shared import spock.lang.Shared
import spock.lang.Specification import spock.lang.Specification
@ -14,6 +15,7 @@ import java.lang.ref.WeakReference
import java.util.concurrent.TimeUnit import java.util.concurrent.TimeUnit
import java.util.concurrent.atomic.AtomicInteger import java.util.concurrent.atomic.AtomicInteger
@Requires({ !System.getProperty("java.vm.name").contains("IBM J9 VM") })
class TracerTest extends Specification { class TracerTest extends Specification {
@Shared @Shared

View File

@ -255,22 +255,6 @@ def isJdkForced(String javaName) {
return (project.hasProperty('forceJdk') && project.getProperty('forceJdk').contains(javaName)) return (project.hasProperty('forceJdk') && project.getProperty('forceJdk').contains(javaName))
} }
// JVM names we would like to run complete test suite on
// Note: complete test suite is always run on JVM used for compilation
// Note2: apparently there is no way to have a 'global' variable, so instead we have per project
// attribute that has same value in all projects
project.ext.majorSupportedJVMs = ["7", "11"]
def isTestingEnabled(String javaName) {
if (javaName in project.majorSupportedJVMs) {
return true
}
if (project.findProperty("coreJavaInstrumentation") || project.findProperty("integrationTests")) {
return true
}
return false
}
// Disable default test tasks if current JVM doesn't match version requirements // Disable default test tasks if current JVM doesn't match version requirements
tasks.withType(Test).configureEach { tasks.withType(Test).configureEach {
if (name.endsWith("Generated")) { if (name.endsWith("Generated")) {
@ -326,7 +310,7 @@ for (def env : System.getenv().entrySet()) {
jvmArgs '-XX:CompileCommand=exclude,net.bytebuddy.description.type.TypeDescription$Generic$Visitor$Substitutor::onParameterizedType' jvmArgs '-XX:CompileCommand=exclude,net.bytebuddy.description.type.TypeDescription$Generic$Visitor$Substitutor::onParameterizedType'
} }
onlyIf { (isJavaVersionAllowed(javaVersion) && isTestingEnabled(javaName)) || isJdkForced(javaName) } onlyIf { isJavaVersionAllowed(javaVersion) || isJdkForced(javaName) }
if (applyCodeCoverage) { if (applyCodeCoverage) {
jacoco { jacoco {
// Disable jacoco for additional JVM tests to speed things up a bit // Disable jacoco for additional JVM tests to speed things up a bit