Skip to content

Set SIMPLECOV=yes on the Codecov lane in module_ci - #188

Merged
LukasAud merged 1 commit into
mainfrom
MODULES-11965-simplecov
Oct 12, 2026
Merged

LukasAud merged 1 commit into
mainfrom
MODULES-11965-simplecov

Conversation

@imaqsood

Copy link
Copy Markdown
Contributor

Summary

The Codecov upload added in #187 (70e9e0b) uploads coverage/.resultset.json, but nothing in module_ci.yml turns SimpleCov on. So the file is never written, and with fail_ci_if_error: true the Ruby 3.2 spec lane fails on every repo that has CODECOV_TOKEN set, even though all specs pass. Example: provision#298, run 36859169697: 85 examples, 0 failures, then "No coverage reports found".

puppetlabs_spec_helper only starts SimpleCov when ENV['SIMPLECOV'] == 'yes' (module_spec_helper.rb). This PR sets SIMPLECOV on the "Run tests" step under the same condition as the upload step (ubuntu-latest && Ruby 3.2 && CODECOV_TOKEN set), and no otherwise. Repos without the token are unaffected. That matters because SIMPLECOV=yes raises if simplecov/simplecov-console aren't in the module's Gemfile.

Found while working on MODULES-11965.

Test plan

  • ruby -ryaml parses the workflow.
  • Locally in puppetlabs/provision: bundle exec rake parallel_spec writes no coverage/.resultset.json; SIMPLECOV=yes bundle exec rake parallel_spec writes it.
  • actionlint (not installed locally; CI will validate the expression syntax).
  • After merge: re-run the ci workflow on provision#298. The Puppet 8 / Ruby 3.2 lane should upload coverage and pass.

🤖 Generated with Claude Code

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>
@imaqsood
imaqsood requested review from a team as code owners October 12, 2026 03:48
@LukasAud
LukasAud requested a balanced review from Copilot October 12, 2026 08:42

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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 SIMPLECOV based 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

@LukasAud LukasAud left a comment

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.

LGTM

@LukasAud
LukasAud merged commit e512c42 into main Oct 12, 2026
3 checks passed
@LukasAud
LukasAud deleted the MODULES-11965-simplecov branch October 12, 2026 09:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants