CMP-4410: exclude generated and vendored code from coverage reports#1291
Conversation
|
@taimurhafeez: This pull request references CMP-4410 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "5.0.0" version, but no target version was set. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: taimurhafeez The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/retest-required |
1 similar comment
|
/retest-required |
|
🤖 To deploy this PR, run the following command: |
Adds a coverage ratchet to the unit test workflow: make test-unit now runs with -cover, captures native go test per-package coverage output, and compares it against a committed baseline. The coverage check fails if any package regresses below the baseline or if coverage has improved and the baseline is out of date, ensuring it stays current. New files: - hack/check-coverage.sh: parses go test output (plain and JSON formats) and compares per-package coverage against the baseline - hack/update-coverage-baseline.sh: generates the baseline from go test output - coverage-baseline.txt: committed baseline with current per-package coverage percentages Makefile changes: - test-unit captures output via tee and runs check-coverage if a baseline exists - New update-coverage-baseline and check-coverage targets - TESTABLE_PKGS filters to packages with test files to avoid go 1.25 covdata tool errors on empty packages Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
5a766c6 to
9ebdccf
Compare
|
🤖 To deploy this PR, run the following command: |
|
@taimurhafeez: The following tests failed, say
Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
Coverage reports now use -
coverprofile for file-level granularity, filtering out auto-generated files (zz_generated.deepcopy.go, counterfeiter fakes) before computing per-package percentages. Exclusion patterns are defined in one place (hack/filter-coverage.sh).Co-authored by Claude.