Skip to content

build: Move OpenTelemetry agent test wiring into a convention plugin - #6551

Merged
runningcode merged 1 commit into
mainfrom
no/java-801-otel-agent-tests-plugin
Nov 11, 2026
Merged

runningcode merged 1 commit into
mainfrom
no/java-801-otel-agent-tests-plugin

Conversation

@runningcode

Copy link
Copy Markdown
Contributor

📜 Description

The Spring Boot 2, 3 and 4 modules each had a copy of the setup that runs the OpenTelemetry agent tests in a child JVM. The copies were identical apart from their dependency lists. This moves them into one convention plugin, io.sentry.otel-agent-tests, in build-logic next to ChildJvmTestArguments.

The plugin:

  • creates the agentFixture source set for the app
  • creates otelAgentJar and adds the dependency on the built (shadowed) agent
  • registers the integrationTestOtelAgent suite and the integrationTestOtelAgentWithoutAutoInit task, both wired to the child JVM

The two agent entries in each module's springBootMatrix block were identical too, so they are now one otelAgentTests() call.

Each module keeps only the dependencies of its app and its suite. The suite's shared test dependencies (sentry-test-support, JUnit, Truth) stay in the modules as well, so every suite lists its own dependencies the same way.

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

💡 Motivation and Context

Each module had 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. That knowledge now lives in one place.

💚 How did you test it?

Ran integrationTestOtelAgent and integrationTestOtelAgentWithoutAutoInit in all three modules, plus both matrix tasks on the oldest version of each line (2.7.0, 3.2.12 and 4.0.0). All pass.

📝 Checklist

  • I added GH Issue ID & Linear ID
  • I added tests to verify the changes.
  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled.
  • I updated the docs if needed.
  • I updated the wizard if needed.
  • Review from the native team if needed.
  • No breaking change or entry added to the changelog.
  • No breaking change for hybrid SDKs or communicated to hybrid SDKs.
  • Public API changes reviewed by another Mobile SDK team member or implemented according to the develop docs spec.

🔮 Next steps

🤖 Generated with Claude Code

#skip-changelog

The Spring Boot 2, 3 and 4 modules each copied the setup that runs the agent tests in a child
JVM. The io.sentry.otel-agent-tests plugin now owns it, so the modules keep only the dependencies
of their Spring Boot line.

Fixes #6378
Fixes JAVA-801

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@runningcode
runningcode requested review from a team and adinauer as code owners November 11, 2026 08:54
@runningcode
runningcode requested review from 0xadam-brown and markushi and removed request for a team November 11, 2026 08:54
@linear-code

linear-code Bot commented Nov 11, 2026

Copy link
Copy Markdown

JAVA-801

@sentry

sentry Bot commented Nov 11, 2026

Copy link
Copy Markdown

📲 Install Builds

Android

🔗 App Name App ID Version Configuration
SDK Size io.sentry.tests.size 8.63.0 (1) release

⚙️ sentry-android Build Distribution Settings

@runningcode runningcode added the ship-it PR is ready to merge from a reviewer perspective label Nov 11, 2026

@0xadam-brown 0xadam-brown left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm, and my clanker thinks so too. (Up to you if want to @adinauer to take a look as well.)

@runningcode
runningcode merged commit 237a5fa into main Nov 11, 2026
48 checks passed
@runningcode
runningcode deleted the no/java-801-otel-agent-tests-plugin branch November 11, 2026 10:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ship-it PR is ready to merge from a reviewer perspective

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Extract the OpenTelemetry agent test wiring into a convention plugin

2 participants