Skip to content

Commit

Permalink
Account for ProxyTracerProvider
Browse files Browse the repository at this point in the history
Updated tests that relied on unset tracer being a noop tracer instead of a proxy tracer
  • Loading branch information
owais committed Apr 3, 2021
1 parent 12da395 commit 255488d
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
- 'release/*'
pull_request:
env:
CORE_REPO_SHA: f556d1418c8015b71ec2e16b4ba2b76efdd3804f
CORE_REPO_SHA: 763730ca001c757e682115503c3b8106734c5573

jobs:
build:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,10 +177,8 @@ def test_suppress_instrumentation(self):
def test_not_recording(self):
with mock.patch("opentelemetry.trace.INVALID_SPAN") as mock_span:
RequestsInstrumentor().uninstrument()
# original_tracer_provider returns a default tracer provider, which
# in turn will return an INVALID_SPAN, which is always not recording
RequestsInstrumentor().instrument(
tracer_provider=self.original_tracer_provider
tracer_provider=trace._DefaultTracerProvider
)
mock_span.is_recording.return_value = False
result = self.perform_request(self.URL)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -208,10 +208,8 @@ def test_suppress_instrumentation(self):
def test_not_recording(self):
with mock.patch("opentelemetry.trace.INVALID_SPAN") as mock_span:
URLLibInstrumentor().uninstrument()
# original_tracer_provider returns a default tracer provider, which
# in turn will return an INVALID_SPAN, which is always not recording
URLLibInstrumentor().instrument(
tracer_provider=self.original_tracer_provider
tracer_provider=trace._DefaultTracerProvider
)
mock_span.is_recording.return_value = False
result = self.perform_request(self.URL)
Expand Down

0 comments on commit 255488d

Please sign in to comment.