Add CODECOV_TOKEN to linux_tests env to enable coverage upload - #392
Merged
Merged
Conversation
- Add CODECOV_TOKEN to linux_tests env in ci.yml so the codecov gem (already present in the :tests Gemfile group and wired up via puppetlabs_spec_helper/module_spec_helper) has a token to upload coverage results with. - Narrow the /Creating/ regex in get_calls_spec.rb to /\]: Creating/ to avoid a false positive on Windows where Puppet emits "Info: Creating state file ..." at the end of every run. The broader regex matched that unrelated message, causing the test to fail even when no resources were actually being created. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
bronachfalls
force-pushed
the
add-codecov-upload
branch
from
September 21, 2026 09:04
21b8225 to
13130a6
Compare
actowery
approved these changes
Sep 22, 2026
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.
Two changes:
Enable Codecov upload
The codecov gem is already present in the :tests Gemfile group, and puppetlabs_spec_helper/module_spec_helper already auto-requires it and registers it as a SimpleCov formatter. The only missing piece was CODECOV_TOKEN not being set in the linux_tests job env — without it the gem has no token to upload coverage results with. This adds it.
Fix false-positive test failure on Windows (get_calls_spec.rb)
Four tests used not_to match(/Creating/) to assert that no resources were created during a puppet apply run. On Windows, Puppet emits Info: Creating state file C:/ProgramData/PuppetLabs/puppet/cache/state/state.yaml at the end of every run regardless of what resources are managed. This unrelated line was matching the overly broad regex and causing the tests to fail even when no resources were actually being created.
The fix narrows the regex to /]: Creating/, which matches the format of real resource creation log lines (e.g. Notice: test_get_calls_basic[foo]: Creating:) but not the state file message.
Summary
Provide a detailed description of all the changes present in this pull request.
Additional Context
Add any additional context about the problem here.
Related Issues (if any)
Mention any related issues or pull requests.
Checklist