test(observability): re-enable OtlpExportIntegrationTest - #198
Open
adityamparikh wants to merge 2 commits into
Open
test(observability): re-enable OtlpExportIntegrationTest#198adityamparikh wants to merge 2 commits into
adityamparikh wants to merge 2 commits into
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Removes the class-level
@DisabledfromOtlpExportIntegrationTest, 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
ClassNotFoundExceptionfororg.eclipse.jetty.client.transport.HttpClientTransportOverHTTPwhen starting the Grafana LGTM Testcontainer. The Jetty pin has moved since (SolrJ 10 bump);jetty-client12.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 thehttpprofile, so there is no MCP request and no principal. Instead of settinghttp.security.enabled=false(asDistributedTracingTestdoes), the test authenticates its own thread with aTestingAuthenticationTokenin@BeforeEachand clears it in@AfterEach. Secure-by-default and method security stay on; OTLP export is verified against the real LGTM stack.Verification
./gradlew buildon Java 25: 403 tests, 0 failures, 0 skipped (the 7 previously skipped OTLP methods now run and pass).OtlpExportIntegrationTest7/7 againstgrafana/otel-lgtm:latest.🤖 Generated with Claude Code
https://claude.ai/code/session_019zJ9WA8nNyA5Yxb8ueM7vV