Skip to content

fix: exclude generated and non-library code from codecov coverage - #1894

Merged
tekton-robot merged 1 commit into
tektoncd:mainfrom
khrm:fix-codecov-ignore-patterns
Aug 20, 2026
Merged

fix: exclude generated and non-library code from codecov coverage#1894
tekton-robot merged 1 commit into
tektoncd:mainfrom
khrm:fix-codecov-ignore-patterns

Conversation

@khrm

@khrm khrm commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Codecov reports low coverage because it includes auto-generated code, vendored deps, CLI entry points, and test infrastructure in the denominator. Filter these out so coverage reflects actual library code. Mirrors the approach proven in tektoncd/triggers#2101.

  • Replace bare go test ./... with filtered package list + -coverpkg
  • Strip zz_generated.deepcopy.go from profile
  • Add disable_search: true to codecov upload step
  • Use bare directory names in .codecov.yaml

Changes

Submitter Checklist

As the author of this PR, please check off the items in this checklist:

  • Has Docs included if any changes are user facing
  • Has Tests included if any functionality added or changed
  • Follows the commit message standard
  • Meets the Tekton contributor standards (including
    functionality, content, code)
  • Release notes block below has been updated with any user facing changes (API changes, bug fixes, changes requiring upgrade notices or deprecation warnings)
  • Release notes contains the string "action required" if the change requires additional action from users switching to the new release

Release Notes

NONE

@tekton-robot tekton-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Aug 18, 2026

@khrm khrm left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

/kind misc

@tekton-robot tekton-robot added the kind/misc Categorizes issue or PR as a miscellaneuous one. label Aug 18, 2026
@codecov

codecov Bot commented Aug 18, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 72.47%. Comparing base (c072726) to head (c6c50b6).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff             @@
##             main    #1894       +/-   ##
===========================================
+ Coverage   62.20%   72.47%   +10.26%     
===========================================
  Files          64       58        -6     
  Lines        4088     3854      -234     
===========================================
+ Hits         2543     2793      +250     
+ Misses       1265      768      -497     
- Partials      280      293       +13     
Flag Coverage Δ
unit-tests 72.47% <ø> (+10.26%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@khrm
khrm force-pushed the fix-codecov-ignore-patterns branch from 80a2fde to 24c165e Compare August 18, 2026 15:26
Codecov reports low coverage because it includes auto-generated code,
vendored deps, CLI entry points, and test infrastructure in the
denominator. Filter these out so coverage reflects actual library code.
Mirrors the approach proven in tektoncd/triggers#2101.

- Replace bare `go test ./...` with filtered package list + `-coverpkg`
- Strip zz_generated.deepcopy.go from profile
- Add `disable_search: true` to codecov upload step
- Use bare directory names in .codecov.yaml

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@khrm
khrm force-pushed the fix-codecov-ignore-patterns branch from 24c165e to c6c50b6 Compare August 18, 2026 15:40
@tekton-robot tekton-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 19, 2026

@waveywaves waveywaves left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

/lgtm

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Aug 20, 2026
@tekton-robot

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: infernus01, waveywaves

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

@tekton-robot
tekton-robot merged commit 1be0e45 into tektoncd:main Aug 20, 2026
21 of 22 checks passed
@khrm
khrm deleted the fix-codecov-ignore-patterns branch August 20, 2026 11:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. kind/misc Categorizes issue or PR as a miscellaneuous one. lgtm Indicates that a PR is ready to be merged. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants