68 lines
2.3 KiB
Groovy
68 lines
2.3 KiB
Groovy
apply from: "${rootDir}/gradle/java.gradle"
|
|
|
|
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 {
|
|
testCompile project(':dd-trace-api')
|
|
testCompile project(':dd-trace-ot')
|
|
|
|
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=LogWriter", "-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}"
|
|
}
|
|
|
|
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"
|