Skip to content

Remove unused legacy codecov gem from Gemfile - #299

Merged
gavindidrichsen merged 1 commit into
mainfrom
remove-legacy-codecov-gem
Oct 12, 2026
Merged

gavindidrichsen merged 1 commit into
mainfrom
remove-legacy-codecov-gem

Conversation

@LukasAud

Copy link
Copy Markdown
Contributor

Summary

The first nightly run after cat-github-actions#188 merged (setting SIMPLECOV=yes on the Codecov lane) hung on "Run tests" for 20+ minutes instead of the usual ~10 seconds: https://github.com/puppetlabs/provision/actions/runs/38230880363/job/114749911485 (cancelled).

puppetlabs_spec_helper's module_spec_helper.rb does this whenever SIMPLECOV=yes:

begin
  require 'codecov'
  SimpleCov.formatters << SimpleCov::Formatter::Codecov
rescue LoadError
  # continue without codecov
end

This repo's Gemfile has gem "codecov", require: false (leftover from an old Travis/.sync.yml simplecov: true setup), so the require succeeds and that formatter gets registered. Its format method makes a real synchronous Net::HTTP call straight to https://codecov.io/upload/v4 (falling back to /upload/v2), with retries on timeout/socket errors, and explicitly disables WebMock first so the call isn't stubbed. That legacy direct-upload API was replaced years ago by the codecov CLI that codecov-action@v4 already uses — hitting it now appears to hang rather than fail fast, which is what stalled the job.

Removing the gem makes that require raise LoadError, which is caught and ignored — SimpleCov just skips that formatter. The HTML + Console formatters still write coverage/.resultset.json, which is all codecov-action needs.

Test plan

  • Re-run nightly and confirm "Run tests" completes in roughly the same time as before SIMPLECOV was introduced, with the Codecov upload step still succeeding.

🤖 Generated with Claude Code

Pulling in simplecov/simplecov-console now (module_ci.yml PR #188) also
activates puppetlabs_spec_helper's SimpleCov::Formatter::Codecov, since
the codecov gem happens to be present. That formatter makes a real
synchronous HTTP upload straight to codecov.io's long-deprecated v4/v2
API, which hung for 20+ minutes in the first nightly run after the
change landed. The actual coverage upload goes through codecov-action
already; HTML/Console formatters alone are enough to produce the
resultset.json it reads.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@LukasAud
LukasAud requested a review from a team as a code owner October 12, 2026 10:37
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (main@0ccea8f). Learn more about missing BASE report.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #299   +/-   ##
=======================================
  Coverage        ?   91.31%           
=======================================
  Files           ?        7           
  Lines           ?      518           
  Branches        ?        0           
=======================================
  Hits            ?      473           
  Misses          ?       45           
  Partials        ?        0           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@gavindidrichsen
gavindidrichsen merged commit 0764bdb into main Oct 12, 2026
5 checks passed
@gavindidrichsen
gavindidrichsen deleted the remove-legacy-codecov-gem branch October 12, 2026 12:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants