non-production: set up codecov in this repo - #14
Merged
Merged
Conversation
- Pass secrets: inherit to the shared ruby-test-matrix workflow so CODECOV_TOKEN reaches the Codecov upload step - Add simplecov and simplecov-lcov, emitting coverage/lcov.info on CI - Add repo-level codecov.yml (coverage at or below 80%)
Newest minitest (6.x) no longer autoloads minitest/mock from minitest/autorun; the Mock/Stub code was extracted into the separate minitest-mock gem. This was a latent issue on master, exposed once the unlocked gemfile resolved minitest 6 under Ruby >= 3.2.
There was a problem hiding this comment.
Pull request overview
Sets up Codecov coverage reporting for this Ruby gem repository by adding SimpleCov instrumentation, Codecov configuration, and CI secret propagation to enable uploads from the existing reusable CI workflow.
Changes:
- Add
simplecov+simplecov-lcovand atest/simplecov_helper.rbto generate HTML locally and LCOV in GitHub Actions. - Fix CI failures with newer Minitest by adding
minitest-mockand explicitly requiringminitest/mock. - Add
codecov.ymland ignore generatedcoverage/output.
Reviewed changes
Copilot reviewed 6 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
test/test_helper.rb |
Loads coverage helper first and explicitly requires minitest/mock for Minitest 6 compatibility. |
test/simplecov_helper.rb |
Starts SimpleCov, configures LCOV output on GitHub Actions, and HTML output otherwise. |
Gemfile |
Adds dev dependencies: minitest-mock, simplecov, simplecov-lcov. |
Gemfile.lock |
Locks new dependencies (minitest-mock, simplecov, formatters). |
gemfiles/unlocked.gemfile |
Mirrors new dev deps into the appraisal/unlocked gemfile. |
codecov.yml |
Adds minimal Codecov status config with permissive thresholds. |
.gitignore |
Ignores coverage/ artifacts. |
.github/workflows/pipeline.yml |
Forwards secrets to reusable workflow to enable Codecov upload. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
7
to
11
| tests: | ||
| uses: Invoca/ruby-test-matrix-workflow/.github/workflows/ruby-test-matrix.yml@main | ||
| secrets: inherit | ||
| with: | ||
| test-command: "bundle exec rake test" |
| add_filter "/test/" | ||
| track_files "lib/**/*.rb" | ||
|
|
||
| if ENV["GITHUB_ACTIONS"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Sets up Codecov coverage reporting for this repo.
Local verification: bundle exec rake test passes (10 runs, 0 failures) on Ruby 3.4.5; GITHUB_ACTIONS=true run produced coverage/lcov.info.
CI fix (latent issue exposed by re-enabling the Pipeline workflow): The unlocked-gemfile matrix legs on Ruby 3.2–3.4 failed with
NameError: uninitialized constant Minitest::Mock. Root cause: minitest 6 (resolved bygemfiles/unlocked.gemfileon Ruby >= 3.2) no longer autoloadsminitest/mockfromminitest/autorun— the Mock/Stub code was extracted into the separateminitest-mockgem. This reproduces identically onorigin/masterwith the unlocked gemfile, so it is pre-existing, not caused by the codecov changes; it only surfaced now because this repo's CI had been disabled for inactivity. Fix: addminitest-mockto the Gemfile development group (regeneratinggemfiles/unlocked.gemfilevia appraisal) and requireminitest/mockexplicitly intest/test_helper.rb. Verified locally on Ruby 3.4.5 and 3.2.2 (unlocked gemfile) and 3.4.5 (locked Gemfile): 10 runs, 0 failures.