Skip to content

Commit

Permalink
NoOpTracerProvider test cases added
Browse files Browse the repository at this point in the history
Signed-off-by: Shwejan Bhupathi <[email protected]>
  • Loading branch information
shwejanraj committed Jun 24, 2024
1 parent 919b2c2 commit feaf13b
Showing 1 changed file with 20 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,13 @@ def test_s3_client(self):

s3.list_buckets()
self.assert_span("S3", "ListBuckets")

@mock_s3
def test_no_op_tracer_provider_s3(self):
BotocoreInstrumentor().uninstrument()
BotocoreInstrumentor().instrument(
tracer_provider = trace_api.NoOpTracerProvider()
)

@mock_aws
def test_s3_put(self):
Expand Down Expand Up @@ -203,6 +210,19 @@ def test_kinesis_client(self):

kinesis.list_streams()
self.assert_span("Kinesis", "ListStreams")

@mock_kinesis
def test_no_op_tracer_provider_kinesis(self):
BotocoreInstrumentor().uninstrument()
BotocoreInstrumentor().instrument(
tracer_provider = trace_api.NoOpTracerProvider()
)

kinesis = self._make_client("kinesis")
kinesis.list_streams()

spans_list = self.memory_exporter.get_finished_spans()
self.assertEqual(len(spans_list), 0)

@mock_aws
def test_unpatch(self):
Expand Down

0 comments on commit feaf13b

Please sign in to comment.