Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
describe OpenTelemetry::Instrumentation::HttpClient do
let(:instrumentation) { OpenTelemetry::Instrumentation::HttpClient::Instrumentation.instance }

before { skip unless ENV['BUNDLE_GEMFILE'].include?('stable') }

it 'has #name' do
_(instrumentation.name).must_equal 'OpenTelemetry::Instrumentation::HttpClient'
end
Expand All @@ -22,9 +20,23 @@
_(instrumentation.version).wont_be_empty
end

describe '#install' do
it 'accepts argument' do
instrumentation.install({})
describe 'determine_semconv' do
it 'returns "dup" when OTEL_SEMCONV_STABILITY_OPT_IN includes http/dup' do
OpenTelemetry::TestHelpers.with_env('OTEL_SEMCONV_STABILITY_OPT_IN' => 'http/dup') do
_(instrumentation.send(:determine_semconv)).must_equal('dup')
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hannahramadan Is there another way to address this? It seems to me that breaking encapsulation for the purposes of testing is probably not the best way to validate this or increase coverage.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure test coverage is an issue any longer after merging ##2272. Here is a test run with a PR that bumps up the coverage to 85% for http_client.

@thompson-tomo as the author of this ticket, can you confirm?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is correct, it is no longer an issue. I was letting the pr's be reviewed as any chance to improve coverage is worthwhile.

It looks like with the latest calculation it is already 100%. So happy for this PR to be closed.

end
end

it 'returns "old" when OTEL_SEMCONV_STABILITY_OPT_IN is old' do
OpenTelemetry::TestHelpers.with_env('OTEL_SEMCONV_STABILITY_OPT_IN' => 'old') do
_(instrumentation.send(:determine_semconv)).must_equal('old')
end
end

it 'returns "stable" when OTEL_SEMCONV_STABILITY_OPT_IN is empty' do
OpenTelemetry::TestHelpers.with_env('OTEL_SEMCONV_STABILITY_OPT_IN' => '') do
_(instrumentation.send(:determine_semconv)).must_equal('stable')
end
end
end
end
Loading