Skip to content

[CI] Add test coverage reporting #142

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 7, 2025

Conversation

ByteOtter
Copy link
Contributor

What this PR does / why we need it:

This PR adds automated test coverage reporting via Codecov.
During development it is easy to lose sight of keeping acceptable test coverage. This new CI will help with that by automatically running pytest-cov and reporting test coverage back to the contributors.

It includes:

  • A Web Interface that can be accessed by all organization members with which we can track current and past coverage rates
  • A bot that automatically reports its findings back to the contributor as a PR comment, including annotations.
  • Configurable failure rate (now set to 50%) to increase acceptable coverage standards as we fill in gaps.
Codecov dashboard of a test run showing 55 percent coverage over python-gardenlinux-lib

Which issue(s) this PR fixes:
Fixes: #139
Tracks: #138

Special notes for your reviewer:

For this change to take effect, the organization admin has to connect the organisation (or a specific repo from it) to Codecov and create an upload token. Information about how to do this is here: https://docs.codecov.com/docs/quick-start

Release note:

NONE

@yeoldegrove yeoldegrove self-requested a review July 16, 2025 14:54
@yeoldegrove yeoldegrove added the enhancement New feature or request label Jul 16, 2025
@yeoldegrove yeoldegrove added this to the 2025-07 milestone Jul 16, 2025
@ByteOtter ByteOtter force-pushed the ci/add-coverage-report branch from a8c8845 to f6b7719 Compare July 16, 2025 15:30
Copy link

codecov bot commented Jul 16, 2025

Welcome to Codecov 🎉

Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests.

Thanks for integrating Codecov - We've got you covered ☂️

@yeoldegrove
Copy link
Contributor

https://app.codecov.io/gh/gardenlinux/python-gardenlinux-lib/pull/142/tree would be the coverage report for this PR.
We'll discuss in the team if we want to have enable codecov.

@NotTheEvilOne NotTheEvilOne self-requested a review July 24, 2025 07:51
@pnpavlov pnpavlov modified the milestones: 2025-07, 2025-08 Aug 1, 2025
@ByteOtter ByteOtter force-pushed the ci/add-coverage-report branch 2 times, most recently from 278ba09 to be8e739 Compare August 6, 2025 13:56
@ByteOtter ByteOtter requested a review from NotTheEvilOne August 6, 2025 15:05
@ByteOtter
Copy link
Contributor Author

I think I have now updated the workflow with all concerns in mind, and wil be splitting the other changes off into actions/setup as we discussed

@ByteOtter ByteOtter force-pushed the ci/add-coverage-report branch from 80bdec1 to c0f9206 Compare August 7, 2025 08:52
Copy link
Contributor

@NotTheEvilOne NotTheEvilOne left a comment

Choose a reason for hiding this comment

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

LGTM

@ByteOtter
Copy link
Contributor Author

Thanks for your help I'll clean the git history and merge it :)

* Add pytest and pytest-cov to dev dependencies
* Switch to relative path to local setup action
@ByteOtter ByteOtter force-pushed the ci/add-coverage-report branch from c0f9206 to 9d883bf Compare August 7, 2025 08:58
@ByteOtter ByteOtter merged commit b305d15 into gardenlinux:main Aug 7, 2025
5 checks passed
@ByteOtter ByteOtter deleted the ci/add-coverage-report branch August 7, 2025 09:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make test coverage visbible
4 participants