Skip to content

Commit

Permalink
Merge pull request #973 from DataDog/landerson/all-tests-on-all-jvms
Browse files Browse the repository at this point in the history
Run all tests on all java versions
  • Loading branch information
randomanderson authored Sep 4, 2019
2 parents 02adf46 + 619ecb8 commit 983b4e2
Show file tree
Hide file tree
Showing 13 changed files with 5 additions and 78 deletions.
6 changes: 0 additions & 6 deletions dd-java-agent/dd-java-agent.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,6 @@ plugins {
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'

apply from: "${rootDir}/gradle/java.gradle"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,6 @@
* 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 {
pass {
group = "org.hibernate"
Expand Down
Original file line number Diff line number Diff line change
@@ -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 {
pass {
group = "org.hibernate"
Expand Down
Original file line number Diff line number Diff line change
@@ -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 {
pass {
group = "org.hibernate"
Expand Down
Original file line number Diff line number Diff line change
@@ -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"

dependencies {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
// Set properties before any plugins get loaded
ext {
minJavaVersionForTests = JavaVersion.VERSION_1_8
// Execute tests on all JVMs, even rare and outdated ones
coreJavaInstrumentation = true
}

apply from: "${rootDir}/gradle/java.gradle"
Expand Down
Original file line number Diff line number Diff line change
@@ -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/test-with-scala.gradle"

Expand Down
Original file line number Diff line number Diff line change
@@ -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/test-with-scala.gradle"
apply from: "${rootDir}/gradle/test-with-kotlin.gradle"
Expand Down
Original file line number Diff line number Diff line change
@@ -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/test-with-scala.gradle"

Expand Down
6 changes: 0 additions & 6 deletions dd-java-agent/instrumentation/jdbc/jdbc.gradle
Original file line number Diff line number Diff line change
@@ -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 plugin: 'org.unbroken-dome.test-sets'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -346,9 +346,9 @@ class SpanImplTest extends Specification {
def "test JSON rendering with big ID values"() {
setup: "create span"
def parentContext = new SpanContextImpl(
new BigInteger(2).pow(64).subtract(1).toString(),
BigInteger.valueOf(2).pow(64).subtract(1).toString(),
"123",
new BigInteger(2).pow(64).subtract(2).toString())
BigInteger.valueOf(2).pow(64).subtract(2).toString())
def span = new SpanImpl(trace, parentContext, startTimestamp)
span.finish()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,15 @@ import datadog.trace.tracer.writer.AgentWriter
import datadog.trace.tracer.writer.SampleRateByService
import datadog.trace.tracer.writer.Writer
import datadog.trace.util.gc.GCUtils
import spock.lang.Requires
import spock.lang.Shared
import spock.lang.Specification

import java.lang.ref.WeakReference
import java.util.concurrent.TimeUnit
import java.util.concurrent.atomic.AtomicInteger

@Requires({ !System.getProperty("java.vm.name").contains("IBM J9 VM") })
class TracerTest extends Specification {

@Shared
Expand Down
18 changes: 1 addition & 17 deletions gradle/java.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -255,22 +255,6 @@ def isJdkForced(String 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
tasks.withType(Test).configureEach {
if (name.endsWith("Generated")) {
Expand Down Expand Up @@ -326,7 +310,7 @@ for (def env : System.getenv().entrySet()) {
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) {
jacoco {
// Disable jacoco for additional JVM tests to speed things up a bit
Expand Down

0 comments on commit 983b4e2

Please sign in to comment.