Gradle plugin for gathering data of JUnit test executions via OpenTelemetry
Add the dependency to your build.gradle
dependencies {
testImplementation 'com.dynatrace.oss.opentelemetry:junit.jupiter.exporter:${version}'
}
Make sure that the extension is loaded. This can be done in different ways.
- Put an annotation over your test class
@ExtendWith(TracingExtension.class)
public class Test {
- Load the extensions via parameter
-Djunit.jupiter.extensions.autodetection.enabled=true
- Set a system property
systemProperty("junit.jupiter.extensions.autodetection.enabled", true)
The recommended way is to use autoconfigure to do that.
implementation 'io.opentelemetry:opentelemetry-sdk-extension-autoconfigure:${version}'
This is what a trace of a test may look like:
The extension also adds the possibility to trace dynamic and parameterized tests.