Skip to content

Add CODECOV_TOKEN to linux_tests env to enable coverage upload - #392

Merged
actowery merged 1 commit into
mainfrom
add-codecov-upload
Sep 22, 2026
Merged

actowery merged 1 commit into
mainfrom
add-codecov-upload

Conversation

@bronachfalls

@bronachfalls bronachfalls commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

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.

  • Root cause and the steps to reproduce. (If applicable)
  • Thought process behind the implementation.

Related Issues (if any)

Mention any related issues or pull requests.

Checklist

  • 🟢 Spec tests.
  • 🟢 Acceptance tests.
  • Manually verified.

@bronachfalls
bronachfalls requested review from a team as code owners September 18, 2026 13:04
- 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>
@actowery
actowery merged commit 2e11c38 into main Sep 22, 2026
5 checks passed
@actowery
actowery deleted the add-codecov-upload branch September 22, 2026 15:51
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.

2 participants