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

73 lines
2.6 KiB
Groovy

apply plugin: 'io.opentelemetry.instrumentation.auto-instrumentation'
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-api')
implementation project(':library-api')
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 deps.opentelemetryAutoAnnotations
testImplementation project(':instrumentation:annotations')
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 "otel.trace.runtime.context.field.injection": "false"
includes = ["context/FieldBackedProviderFieldInjectionDisabledTest.class"]
}
test.dependsOn(testDisabledFieldInjection)
test.forkEvery 1
javadoc.enabled = false