opentelemetry-java-instrume.../testing-common/testing-common.gradle

75 lines
2.6 KiB
Groovy

apply from: "$rootDir/gradle/java.gradle"
minimumBranchCoverage = 0.5
minimumInstructionCoverage = 0.5
excludedClassesCoverage += [
'io.opentelemetry.auto.test.asserts.*Assert*',
'io.opentelemetry.auto.test.base.*',
'io.opentelemetry.auto.test.log.*',
'io.opentelemetry.auto.test.AgentTestRunner',
'io.opentelemetry.auto.test.InstrumentationTestRunner',
'io.opentelemetry.auto.test.InMemoryExporter.*',
'io.opentelemetry.auto.test.utils.*',
// Avoid applying jacoco instrumentation to classes instrumented by tested agent
'context.ContextTestInstrumentation**',
]
dependencies {
api(project(path: ':opentelemetry-sdk-shaded-for-testing', configuration: 'shadow'))
api deps.guava
api deps.spock
implementation deps.opentelemetryApi
implementation deps.bytebuddy
implementation deps.bytebuddyagent
implementation deps.slf4j
implementation deps.testLogging
// okhttp 3.12.x is the last version to support Java7
api group: 'com.squareup.okhttp3', name: 'okhttp', version: '3.12.12'
api group: 'com.squareup.okhttp3', name: 'logging-interceptor', version: '3.12.12'
//TODO replace with Servlet API?
implementation group: 'org.eclipse.jetty', name: 'jetty-server', version: '8.0.0.v20110901'
implementation(project(':auto-bootstrap'))
implementation(project(':auto-tooling')) {
// including :opentelemetry-sdk-shaded-for-testing above instead
exclude group: 'io.opentelemetry', module: 'opentelemetry-sdk'
}
api project(':utils:test-utils')
annotationProcessor deps.autoservice
implementation deps.autoservice
api deps.groovy
testImplementation project(':instrumentation:annotations')
//TODO replace with Otel WithSpan
testImplementation('io.opentracing.contrib.dropwizard:dropwizard-opentracing:0.2.2') {
// bringing this in has side effects and causes some tests to fail
exclude group: 'io.dropwizard', module: 'dropwizard-core'
}
testImplementation group: 'cglib', name: 'cglib', version: '3.2.5'
// test instrumenting java 1.1 bytecode
//TODO do we want this?
testImplementation group: 'net.sf.jt400', name: 'jt400', version: '6.1'
// We have autoservices defined in test subtree, looks like we need this to be able to properly rebuild this
testAnnotationProcessor deps.autoservice
testImplementation deps.autoservice
}
// See comment for FieldBackedProviderFieldInjectionDisabledTest about why this hack is here
tasks.register("testDisabledFieldInjection", Test) {
systemProperties "ota.trace.runtime.context.field.injection": "false"
includes = ["context/FieldBackedProviderFieldInjectionDisabledTest.class"]
}
test.dependsOn(testDisabledFieldInjection)
javadoc.enabled = false
test.forkEvery = 1