Skip to content

test(faraday): instrumentation test coverage#2184

Open
aabhinavvvvvvv wants to merge 6 commits intoopen-telemetry:mainfrom
aabhinavvvvvvv:fix/faraday-instrumentation-test-coverage
Open

test(faraday): instrumentation test coverage#2184
aabhinavvvvvvv wants to merge 6 commits intoopen-telemetry:mainfrom
aabhinavvvvvvv:fix/faraday-instrumentation-test-coverage

Conversation

@aabhinavvvvvvv
Copy link
Copy Markdown

Summary

Improves test coverage for the faraday instrumentation to meet the 85% SimpleCov threshold (fixes #2156).

  • Rewrites faraday_test.rb to run under the stable appraisal with tests covering name, version, present?, compatible?, and #install on the instrumentation class
  • Adds enable_internal_instrumentation: true test to stable/tracer_middleware_test.rb, old/tracer_middleware_test.rb, and dup/tracer_middleware_test.rb to cover the previously untested else branch in each middleware's call method

@thompson-tomo thompson-tomo changed the title Fix/faraday instrumentation test coverage test(faraday): instrumentation test coverage Apr 22, 2026
@github-actions github-actions Bot added the ci label Apr 22, 2026

describe 'present' do
it 'when faraday gem is installed' do
_(instrumentation.present?).must_equal true
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.

Suggested change
_(instrumentation.present?).must_equal true
assert instrumentation.present?


it 'when Faraday is not defined' do
hide_const('Faraday')
_(instrumentation.present?).must_equal false
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.

Suggested change
_(instrumentation.present?).must_equal false
refute instrumentation.present?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve faraday instrumentation test coverage

2 participants