Skip to content

CMP-4410: exclude generated and vendored code from coverage reports#1291

Open
taimurhafeez wants to merge 4 commits into
ComplianceAsCode:masterfrom
taimurhafeez:CMP-4410-Exclude-generated-and-vendored-code-from-coverage-reports
Open

CMP-4410: exclude generated and vendored code from coverage reports#1291
taimurhafeez wants to merge 4 commits into
ComplianceAsCode:masterfrom
taimurhafeez:CMP-4410-Exclude-generated-and-vendored-code-from-coverage-reports

Conversation

@taimurhafeez

@taimurhafeez taimurhafeez commented Jun 30, 2026

Copy link
Copy Markdown
Collaborator

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.

@openshift-ci-robot

Copy link
Copy Markdown
Collaborator

@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.

Details

In response to this:

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).

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.

@openshift-ci openshift-ci Bot requested review from xiaojiey and yuumasato June 30, 2026 13:31
@openshift-ci

openshift-ci Bot commented Jun 30, 2026

Copy link
Copy Markdown

[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

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@taimurhafeez

Copy link
Copy Markdown
Collaborator Author

/retest-required

1 similar comment
@taimurhafeez

Copy link
Copy Markdown
Collaborator Author

/retest-required

@github-actions

Copy link
Copy Markdown

🤖 To deploy this PR, run the following command:

make catalog-deploy CATALOG_IMG=ghcr.io/complianceascode/compliance-operator-catalog:1291-86aefedb16f0e65ba5034613982eecaa91529f21

rhmdnd and others added 4 commits July 10, 2026 14:54
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>
@taimurhafeez taimurhafeez force-pushed the CMP-4410-Exclude-generated-and-vendored-code-from-coverage-reports branch from 5a766c6 to 9ebdccf Compare July 10, 2026 14:00
@github-actions

Copy link
Copy Markdown

🤖 To deploy this PR, run the following command:

make catalog-deploy CATALOG_IMG=ghcr.io/complianceascode/compliance-operator-catalog:1291-9ebdccf115bbfe88b74c2a2efb5e394281b75633

@openshift-ci

openshift-ci Bot commented Jul 10, 2026

Copy link
Copy Markdown

@taimurhafeez: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/e2e-aws-scan-config 409b260 link true /test e2e-aws-scan-config
ci/prow/e2e-aws-parallel-arm 409b260 link true /test e2e-aws-parallel-arm
ci/prow/e2e-aws-deployment 409b260 link true /test e2e-aws-deployment
ci/prow/e2e-rosa 409b260 link true /test e2e-rosa
ci/prow/e2e-aws-parallel 9ebdccf link true /test e2e-aws-parallel

Full PR test history. Your PR dashboard.

Details

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 kubernetes-sigs/prow repository. I understand the commands that are listed here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants