tests: Omit generated protobuf code from coverage#1865
Merged
Conversation
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>
Emantor
approved these changes
May 12, 2026
Codecov Report✅ All modified and coverable lines are covered by tests. 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
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.