Spec compliance: OTEL_PROPAGATORS should still work when OTEL_SDK_DISABLED#7062
Merged
jack-berg merged 1 commit intoopen-telemetry:mainfrom Feb 7, 2025
Merged
Conversation
b4d723e to
1660f64
Compare
trask
reviewed
Feb 1, 2025
Member
trask
left a comment
There was a problem hiding this comment.
can you see if you can add a test for this?
3bc9876 to
1829e72
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #7062 +/- ##
============================================
- Coverage 89.84% 89.83% -0.01%
- Complexity 6610 6612 +2
============================================
Files 740 740
Lines 19981 19983 +2
Branches 1966 1966
============================================
+ Hits 17951 17952 +1
+ Misses 1440 1439 -1
- Partials 590 592 +2 ☔ View full report in Codecov by Sentry. |
137ee88 to
198625e
Compare
jack-berg
reviewed
Feb 6, 2025
...ure/src/test/java/io/opentelemetry/sdk/autoconfigure/AutoConfiguredOpenTelemetrySdkTest.java
Outdated
Show resolved
Hide resolved
Contributor
Author
|
Interesting. I feel like historically class loaders are pretty hard to test
properly. This test was an attempt in vain to get the code coverage over
90%. Should I just strike it as it’s quite out of scope for this PR?
…On Thu, Feb 6, 2025 at 15:15 jack-berg ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In
sdk-extensions/autoconfigure/src/test/java/io/opentelemetry/sdk/autoconfigure/AutoConfiguredOpenTelemetrySdkTest.java
<#7062 (comment)>
:
> + () ->
+ AutoConfiguredOpenTelemetrySdk.builder()
+ .addPropertiesSupplier(() -> singletonMap("otel.experimental.config.file", ""))
+ .addPropertiesSupplier(() -> singletonMap("otel.sdk.disabled", "true"))
+ .build());
+ }
+
+ @test
+ @SuppressLogger(AutoConfiguredOpenTelemetrySdkBuilder.class)
+ void serviceClassLoader() {
+ ClassLoader classLoader = null;
+ assertThatThrownBy(
+ () -> AutoConfiguredOpenTelemetrySdk.builder().setServiceClassLoader(classLoader))
+ .isInstanceOf(NullPointerException.class)
+ .hasMessageContaining("serviceClassLoader");
+ ClassLoader mockClassLoader = mock(ClassLoader.class);
I think this is what's causing the test to fail: mockito/mockito#1696
(comment)
<mockito/mockito#1696 (comment)>
I can recreate the test failure locally on my machine.
—
Reply to this email directly, view it on GitHub
<#7062 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AA5ZPN2VN5N3FFVKPR45P2D2OPGINAVCNFSM6AAAAABWJNNAG2VHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZDKOJZHE3TENZQGU>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Member
Yeah I think that's the simplest path. |
249232f to
53cd7fe
Compare
53cd7fe to
90a58ef
Compare
jack-berg
approved these changes
Feb 7, 2025
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.
No description provided.