Repository navigation
Set SIMPLECOV=yes on the Codecov lane in module_ci - #188
Merged
Merged
Conversation
The Codecov upload added in 70e9e0b expects coverage/.resultset.json, but nothing in module_ci enabled SimpleCov, so the file is never written and the upload fails the Ruby 3.2 spec lane (fail_ci_if_error: true) on every repo that has CODECOV_TOKEN set, e.g. puppetlabs/provision. puppetlabs_spec_helper only starts SimpleCov when SIMPLECOV == 'yes'. Set it on the "Run tests" step under the same condition as the upload, so repos without the token (and without simplecov in their Gemfile) are unaffected. Co-Authored-By: Claude <noreply@anthropic.com>
There was a problem hiding this comment.
🟡 Changes recommended
The false branch still exports a truthy SIMPLECOV value, potentially enabling coverage unexpectedly.
1 open finding
What changed in this PR
Enables coverage generation for the module_ci Codecov lane.
Changes:
- Configures
SIMPLECOVbased on the existing Codecov upload conditions.
| File | Description |
|---|---|
.github/workflows/module_ci.yml |
Activates SimpleCov for the Ruby 3.2 Ubuntu Codecov lane. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
186
to
191
| - name: "Run tests" | ||
| env: | ||
| # Generate coverage/.resultset.json for the Codecov upload below (same condition). | ||
| SIMPLECOV: ${{ (inputs.runs_on == 'ubuntu-latest' && matrix.ruby_version == '3.2' && env.CODECOV_TOKEN != '') && 'yes' || 'no' }} | ||
| run: | | ||
| bundle exec rake parallel_spec |
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.

Summary
The Codecov upload added in #187 (70e9e0b) uploads
coverage/.resultset.json, but nothing inmodule_ci.ymlturns SimpleCov on. So the file is never written, and withfail_ci_if_error: truethe Ruby 3.2 spec lane fails on every repo that hasCODECOV_TOKENset, even though all specs pass. Example: provision#298, run 36859169697: 85 examples, 0 failures, then "No coverage reports found".puppetlabs_spec_helperonly starts SimpleCov whenENV['SIMPLECOV'] == 'yes'(module_spec_helper.rb). This PR setsSIMPLECOVon the "Run tests" step under the same condition as the upload step (ubuntu-latest&& Ruby 3.2 &&CODECOV_TOKENset), andnootherwise. Repos without the token are unaffected. That matters becauseSIMPLECOV=yesraises ifsimplecov/simplecov-consolearen't in the module's Gemfile.Found while working on MODULES-11965.
Test plan
ruby -ryamlparses the workflow.bundle exec rake parallel_specwrites nocoverage/.resultset.json;SIMPLECOV=yes bundle exec rake parallel_specwrites it.🤖 Generated with Claude Code