Skip to content

Extract the OpenTelemetry agent test wiring into a convention plugin #6378

Open

Description

@runningcode

The Spring Boot 2, 3 and 4 modules each copy the same setup to run their OpenTelemetry agent tests in a child JVM: the agentFixture source set, the otelAgentJar configuration, runAgentFixture, and the integrationTestOtelAgentWithoutAutoInit task. The copies are identical; only the dependency lists differ. Each module also has to know that a plain project dependency on sentry-opentelemetry-agent gives the -dontuse jar, and that the real agent needs Bundling.SHADOWED and a non-transitive configuration.

Move the identical parts into one convention plugin in build-logic (e.g. io.sentry.otel-agent-tests), next to ChildJvmTestArguments:

  • create the agentFixture source set
  • create otelAgentJar and add the dependency on sentry-opentelemetry-agent
  • register the integrationTestOtelAgent suite wired to the child JVM, and the WithoutAutoInit task

The modules keep only their Boot-specific dependencies.

Also fix the comment in sentry-opentelemetry-agent/build.gradle.kts. The runtimeElements jar isn't just a by-product: it holds only AgentMarker, and the Boot modules' unit tests rely on it. The agent itself is shadowRuntimeElements.

Do this after the Boot 4 (#6317) and Boot 2 agent tests land, so the in-flight PRs don't need rewriting.

Activity

  1. linear-code commented on Oct 26, 2026

    @linear-code
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions