Skip to content

test(observability): re-enable OtlpExportIntegrationTest - #198

Open
adityamparikh wants to merge 2 commits into
apache:mainfrom
adityamparikh:test/enable-otlp-export-integration
Open

test(observability): re-enable OtlpExportIntegrationTest#198
adityamparikh wants to merge 2 commits into
apache:mainfrom
adityamparikh:test/enable-otlp-export-integration

Conversation

@adityamparikh

@adityamparikh adityamparikh commented Sep 12, 2026

Copy link
Copy Markdown
Contributor

Summary

Removes the class-level @Disabled from OtlpExportIntegrationTest, which had made every build report 7 skipped tests since observability landed in #41.

Why it was disabled, and why that no longer applies

The annotation cited a ClassNotFoundException for org.eclipse.jetty.client.transport.HttpClientTransportOverHTTP when starting the Grafana LGTM Testcontainer. The Jetty pin has moved since (SolrJ 10 bump); jetty-client 12.0.34 is on the test runtime classpath and contains that class. With the annotation gone the container starts and the OTLP wiring works.

The one real failure, and the fix

Three methods then failed with AuthenticationCredentialsNotFoundException. The test calls @PreAuthorize("isAuthenticated()") service methods directly under the http profile, so there is no MCP request and no principal. Instead of setting http.security.enabled=false (as DistributedTracingTest does), the test authenticates its own thread with a TestingAuthenticationToken in @BeforeEach and clears it in @AfterEach. Secure-by-default and method security stay on; OTLP export is verified against the real LGTM stack.

Verification

./gradlew build on Java 25: 403 tests, 0 failures, 0 skipped (the 7 previously skipped OTLP methods now run and pass). OtlpExportIntegrationTest 7/7 against grafana/otel-lgtm:latest.

🤖 Generated with Claude Code

https://claude.ai/code/session_019zJ9WA8nNyA5Yxb8ueM7vV

The class had been @disabled since #41 because starting the Grafana LGTM
Testcontainer threw a ClassNotFoundException for
org.eclipse.jetty.client.transport.HttpClientTransportOverHTTP. The Jetty
pin has since moved with the SolrJ 10 bump, jetty-client 12.0.34 is on the
test runtime classpath and contains that class, and the container now
starts cleanly.

With the annotation removed, three methods failed with
AuthenticationCredentialsNotFoundException: the test calls @PreAuthorize
service methods directly, with no MCP request and hence no principal. Rather
than switch http.security.enabled off, the test authenticates its own thread
with a TestingAuthenticationToken in @beforeeach and clears it in
@AfterEach, so method security stays active while OTLP export is verified.

All seven methods pass; the build no longer reports any skipped tests.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019zJ9WA8nNyA5Yxb8ueM7vV
Signed-off-by: Aditya Parikh <aditya.m.parikh@gmail.com>
…ticated

The class javadoc still said the test was disabled for a Jetty
ClassNotFoundException; that paragraph now describes the LGTM container and
the self-authenticated test thread. TestingAuthenticationToken's authorities
constructor already marks the token authenticated, so the explicit call goes.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CiUHyyXLTo9ATdgg8eRFZJ
Signed-off-by: Aditya Parikh <aditya.m.parikh@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant