85 lines
3.3 KiB
Groovy
85 lines
3.3 KiB
Groovy
apply from: "${rootDir}/gradle/java.gradle"
|
|
|
|
description = 'dd-java-agent-ittests'
|
|
|
|
evaluationDependsOn(':dd-java-agent:tooling')
|
|
compileTestJava.dependsOn tasks.getByPath(':dd-java-agent:tooling:testClasses')
|
|
|
|
if (!JavaVersion.current().isJava8Compatible()) {
|
|
sourceSets {
|
|
test {
|
|
groovy {
|
|
// These classes use Ratpack which requires Java 8.
|
|
exclude '**/TestHttpServer.groovy', '**/ApacheHttpClientTest.groovy'
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
dependencies {
|
|
testCompile project(':dd-trace-api')
|
|
testCompile project(':dd-trace-ot')
|
|
|
|
testCompile deps.opentracingMock
|
|
|
|
testCompile(project(':dd-java-agent:testing')) {
|
|
// Otherwise this can bring in classes that aren't "shadowed"
|
|
// that conflicts with those that are which are in the agent.
|
|
transitive = false
|
|
}
|
|
|
|
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.eclipse.jetty', name: 'jetty-server', version: '8.2.0.v20160908'
|
|
testCompile group: 'org.eclipse.jetty', name: 'jetty-servlet', version: '8.2.0.v20160908'
|
|
testCompile group: 'org.apache.tomcat.embed', name: 'tomcat-embed-core', version: '8.0.41'
|
|
testCompile group: 'org.apache.tomcat.embed', name: 'tomcat-embed-jasper', version: '8.0.41'
|
|
// note: aws transitively pulls in apache-httpclient, which we also test against:
|
|
// testCompile group: 'org.apache.httpcomponents', name: 'httpclient', version: '4.5.3'
|
|
testCompile(group: 'com.amazonaws', name: 'aws-java-sdk', version: '1.11.119')
|
|
testCompile group: 'com.squareup.okhttp3', name: 'okhttp', version: '3.6.0'
|
|
testCompile(group: 'com.datastax.cassandra', name: 'cassandra-driver-core', version: '3.2.0')
|
|
testCompile(group: 'org.cassandraunit', name: 'cassandra-unit', version: '3.1.3.2') {
|
|
exclude(module: 'netty-handler')
|
|
}
|
|
testCompile group: 'org.apache.logging.log4j', name: 'log4j-api', version: '2.8.2'
|
|
testCompile group: 'org.apache.logging.log4j', name: 'log4j-core', version: '2.8.2'
|
|
|
|
// 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 "-Ddd.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/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"
|