Skip to content

Commit

Permalink
feat: add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
pedrofurtado authored Dec 4, 2024
1 parent ffac037 commit 0b2653d
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions sdk/test/opentelemetry/sdk_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,19 @@
_(received_message).must_match(/unexpected configuration error due to unknown keyword: .*invalid_option/)
end
end

describe '#configure (no-op)' do
before do
ENV['OTEL_SDK_DISABLED'] = 'true'
end

after do
ENV.delete('OTEL_SDK_DISABLED')
end

it 'logs a warning and generate a no-op tracer if env OTEL_SDK_DISABLED is defined' do
tracer = OpenTelemetry::SDK.configure
_(tracer).must_be_instance_of OpenTelemetry::Internal::ProxyTracer
end
end
end

0 comments on commit 0b2653d

Please sign in to comment.