opentelemetry-java-instrume.../dd-java-agent-ittests/dd-java-agent-ittests.gradle

75 lines
2.6 KiB
Groovy

apply from: "${rootDir}/gradle/java.gradle"
// TODO: Test scala in separate project
apply plugin: 'scala'
description = 'dd-java-agent-ittests'
evaluationDependsOn(':dd-java-agent:agent-tooling')
compileTestJava.dependsOn tasks.getByPath(':dd-java-agent:agent-tooling:testClasses')
if (JavaVersion.current() != JavaVersion.VERSION_1_8) {
sourceSets {
test {
groovy {
// These classes use Ratpack which requires Java 8. (Currently also incompatible with Java 9.)
exclude '**/TestHttpServer.groovy', '**/ApacheHttpClientTest.groovy'
}
}
}
}
dependencies {
compile project(':dd-trace-api')
compile project(':dd-trace-ot')
// calling scala classes in spock requires an explicit dependency,
// hence the compile instead of testCompile
compile group: 'org.scala-lang', name: 'scala-library', version: '2.11.12'
testCompile deps.opentracingMock
testCompile deps.testLogging
testCompile group: 'org.mongodb', name: 'mongo-java-driver', version: '3.4.2'
testCompile group: 'org.mongodb', name: 'mongodb-driver-async', version: '3.4.2'
// run embeded mongodb for integration testing
testCompile group: 'de.flapdoodle.embed', name: 'de.flapdoodle.embed.mongo', version: '1.50.5'
testCompile group: 'org.apache.httpcomponents', name: 'httpclient', version: '4.3'
testCompile group: 'com.squareup.okhttp3', name: 'okhttp', version: '3.6.0'
// JDBC tests:
testCompile group: 'com.h2database', name: 'h2', version: '1.4.196'
testCompile group: 'org.hsqldb', name: 'hsqldb', version: '2.3.+'
testCompile group: 'org.apache.derby', name: 'derby', version: '10.12.1.1'
}
test {
jvmArgs "-Ddd.writer.type=ListWriter", "-Ddd.service.name=java-app"
jvmArgs "-Ddatadog.slf4j.simpleLogger.defaultLogLevel=debug"
jvmArgs "-Dorg.slf4j.simpleLogger.defaultLogLevel=debug"
doFirst {
// Defining here to allow jacoco to be first on the command line.
jvmArgs "-javaagent:${project(':dd-java-agent').tasks.shadowJar.archivePath}"
jvmArgs "-Ddd.integration.java_concurrent.enabled=true"
}
testLogging {
events "started"
}
if (project.hasProperty("disableShadowRelocate") && disableShadowRelocate) {
exclude 'datadog/trace/agent/integration/classloading/ShadowPackageRenamingTest.class'
}
}
test.dependsOn project(':dd-java-agent').shadowJar
parent.subprojects.collect { it.tasks.withType(Test) } each {
test.shouldRunAfter it
}
// Jacoco must be applied after the test javaagent config block above,
// otherwise the javaagent args conflict. (It's order dependent and added LIFO)
apply from: "${rootDir}/gradle/jacoco.gradle"