Skip to content

tests: Omit generated protobuf code from coverage#1865

Merged
Emantor merged 1 commit into
labgrid-project:masterfrom
sjg20:push8-coverage
May 12, 2026
Merged

tests: Omit generated protobuf code from coverage#1865
Emantor merged 1 commit into
labgrid-project:masterfrom
sjg20:push8-coverage

Conversation

@sjg20
Copy link
Copy Markdown
Contributor

@sjg20 sjg20 commented May 12, 2026

When a field is added to a .proto file, protoc's regen of labgrid_coordinator_pb2.py shifts the opaque descriptor-bytes literal across dozens of lines. Codecov counts every shifted line as 'modified code that isn't tested', so a tiny 6-line proto change can produce 80+ patch misses and drag the patch coverage down, tripping the per-PR threshold for what is otherwise a routine protocol addition.

Add labgrid/remote/generated/* to .coveragerc's omit list so the generated files no longer count toward coverage. They are machine-produced and exercised implicitly by every test that talks to the coordinator protocol; there is no value in asking unit tests to cover descriptor metadata.

When a field is added to a .proto file, protoc's regen of
labgrid_coordinator_pb2.py shifts the opaque descriptor-bytes literal
across dozens of lines.  Codecov counts every shifted line as 'modified
code that isn't tested', so a tiny 6-line proto change can produce 80+
patch misses and drag the patch coverage down, tripping the per-PR
threshold for what is otherwise a routine protocol addition.

Add labgrid/remote/generated/* to .coveragerc's omit list so the
generated files no longer count toward coverage.  They are
machine-produced and exercised implicitly by every test that talks to
the coordinator protocol; there is no value in asking unit tests to
cover descriptor metadata.

Signed-off-by: Simon Glass <sjg@chromium.org>
@codecov
Copy link
Copy Markdown

codecov Bot commented May 12, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 46.0%. Comparing base (ec5ec29) to head (ec3d222).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff            @@
##           master   #1865     +/-   ##
========================================
+ Coverage    45.8%   46.0%   +0.2%     
========================================
  Files         182     180      -2     
  Lines       14720   14439    -281     
========================================
- Hits         6743    6654     -89     
+ Misses       7977    7785    -192     
Flag Coverage Δ
3.10 46.0% <ø> (+0.2%) ⬆️
3.11 46.0% <ø> (+0.2%) ⬆️
3.12 46.0% <ø> (+0.2%) ⬆️
3.13 46.0% <ø> (+0.2%) ⬆️
3.14 46.0% <ø> (+0.2%) ⬆️

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

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

@Emantor Emantor merged commit db1cba3 into labgrid-project:master May 12, 2026
10 checks passed
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