Skip to content

fix(excon): enable SimpleCov coverage merging across appraisal runs#2193

Open
nicknikolakakis wants to merge 1 commit intoopen-telemetry:mainfrom
nicknikolakakis:fix/2155-excon-test-coverage
Open

fix(excon): enable SimpleCov coverage merging across appraisal runs#2193
nicknikolakakis wants to merge 1 commit intoopen-telemetry:mainfrom
nicknikolakakis:fix/2155-excon-test-coverage

Conversation

@nicknikolakakis
Copy link
Copy Markdown

Summary

  • Set a unique SimpleCov.command_name per appraisal gemfile so coverage data from each semantic convention mode (stable, old, dup) is preserved and merged rather than overwritten
  • This brings combined test coverage from ~58% to 99.19%, meeting the required 85% threshold

Root cause

The excon instrumentation tests 3 semantic convention modes via separate appraisal gemfiles. Each test run loads code for all 3 modes but only exercises one (the others are skipped based on BUNDLE_GEMFILE). Without a unique command_name, each run overwrites the previous one's entry in SimpleCov's .resultset.json, so coverage never reflects the full test suite.

Fix

One line in test_helper.rb derives a unique command_name from BUNDLE_GEMFILE:

SimpleCov.command_name(ENV.fetch('BUNDLE_GEMFILE', 'default').split('/').last.sub('.gemfile', ''))

This produces names like excon_latest_stable, excon_1.3.1_old, etc., allowing SimpleCov to merge results across all appraisal runs.

Coverage

Metric Before After
Per-run coverage ~58% ~58% (unchanged per run)
Merged coverage ~58% (overwrites) 99.19% (proper merge)

The 3 remaining uncovered lines (0.81%) are the rescue StandardError => e safety nets in each middleware's handle_response.

Fixes #2155

Test plan

  • Verified locally: ran all 6 appraisals and confirmed SimpleCov merges coverage to 99.19%
  • Verified SimpleCov.minimum_coverage(85) passes after merge
  • RuboCop passes on the changed file

Set a unique SimpleCov command_name per appraisal gemfile so coverage
data from each semantic convention mode (stable, old, dup) is preserved
and merged rather than overwritten. This brings combined test coverage
from ~58% to 99%, meeting the required 85% threshold.

Fixes open-telemetry#2155

Signed-off-by: Nick Nikolakakis <nonicked@protonmail.com>
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 excon instrumentation test coverage

1 participant