-
Notifications
You must be signed in to change notification settings - Fork 705
Handle none
value for OTEL_PROPAGATORS
#4236
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 2 commits
672a69f
41b0350
b07670f
0e5f610
a78ffd7
883f296
5cbe62f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -49,6 +49,24 @@ def test_propagators(propagators): | |
|
||
reload(opentelemetry.propagate) | ||
|
||
@patch.dict(environ, {OTEL_PROPAGATORS: "none"}) | ||
@patch("opentelemetry.propagators.composite.CompositePropagator") | ||
def test_no_propagators_loaded(self, mock_compositehttppropagator): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I ran this test locally, and it doesn't fail against the main branch There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @emdneto I apologize for the confusion. Could you clarify what you would like me to address? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @Annosha The test should fail on main and raise and exception (as reported in the issue). If it doesn't fail with the current code it means it's not a good test to evaluate if the fix is working. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I was expecting something like that: this should fail when running against main with the ValueError present on the issue
|
||
def test_propagators(propagators): | ||
self.assertEqual( | ||
propagators, [] | ||
) # Expecting an empty list of propagators | ||
|
||
mock_compositehttppropagator.configure_mock( | ||
**{"side_effect": test_propagators} | ||
) | ||
|
||
from importlib import reload | ||
Annosha marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
import opentelemetry.propagate | ||
|
||
reload(opentelemetry.propagate) | ||
|
||
@patch.dict(environ, {OTEL_PROPAGATORS: "a, b, c "}) | ||
@patch("opentelemetry.propagators.composite.CompositePropagator") | ||
@patch("opentelemetry.util._importlib_metadata.entry_points") | ||
|
Uh oh!
There was an error while loading. Please reload this page.