Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: Exclude auto-generated protobuf files from codecov #1048

Merged
merged 2 commits into from
Jan 20, 2023

Conversation

AndrewSisley
Copy link
Contributor

@AndrewSisley AndrewSisley commented Jan 19, 2023

Relevant issue(s)

Resolves #1045

Description

Excludes auto-generated protobuf files from codecov. They accounted for about 3200 line misses (our code base is about 19 000 lines)

@AndrewSisley AndrewSisley added area/testing Related to any test or testing suite area/p2p Related to the p2p networking system action/no-benchmark Skips the action that runs the benchmark. labels Jan 19, 2023
@AndrewSisley AndrewSisley added this to the DefraDB v0.5 milestone Jan 19, 2023
@AndrewSisley AndrewSisley requested a review from a team January 19, 2023 21:30
@AndrewSisley AndrewSisley self-assigned this Jan 19, 2023
Comment on lines 42 to 43
- "net/pb/net.pb.go"
- "net/api/pb/api.pb.go"
Copy link
Collaborator

Choose a reason for hiding this comment

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

question: Could we do **/*.pb.go?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If you prefer? I do like being explicit with this kind of stuff.

Copy link
Collaborator

Choose a reason for hiding this comment

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

To me it's no different than **/*_test.go. We will never want to cover those types of files so might as well just make a catch all and save on ink.

Copy link
Member

Choose a reason for hiding this comment

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

+1 for **/*.pb.go

Copy link
Contributor Author

@AndrewSisley AndrewSisley Jan 20, 2023

Choose a reason for hiding this comment

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

Auto-generated code can still break, and it is prod code unlike **/*_test.go :) Odds are probably really tiny though with something like pb files and the large size results in somewhat misleading codecov results - will change

  • **/*.pb.go

Copy link
Collaborator

Choose a reason for hiding this comment

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

Auto-generated code can still break, and it is prod code

True but it's irrelevant to code coverage reporting.

@shahzadlone
Copy link
Member

shahzadlone commented Jan 20, 2023

I wonder why this PR didn't generate a code coverage report.

I believe this should bump our coverage by ~9-10%

Copy link
Member

@shahzadlone shahzadlone left a comment

Choose a reason for hiding this comment

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

Thanks, this was a good catch.

@codecov
Copy link

codecov bot commented Jan 20, 2023

Codecov Report

Merging #1048 (944ac53) into develop (ad4878e) will increase coverage by 9.54%.
The diff coverage is n/a.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #1048      +/-   ##
===========================================
+ Coverage    58.02%   67.57%   +9.54%     
===========================================
  Files          174      172       -2     
  Lines        19563    16333    -3230     
===========================================
- Hits         11352    11037     -315     
+ Misses        7215     4368    -2847     
+ Partials       996      928      -68     
Impacted Files Coverage Δ
net/client.go 78.04% <0.00%> (-7.32%) ⬇️
net/peer.go 48.32% <0.00%> (-2.16%) ⬇️
net/api/pb/api.pb.go
net/pb/net.pb.go

@AndrewSisley AndrewSisley merged commit e57e22e into develop Jan 20, 2023
@AndrewSisley AndrewSisley deleted the sisley/test/I1045-exclude-pb-from-code-cov branch January 20, 2023 17:06
shahzadlone pushed a commit to shahzadlone/defradb that referenced this pull request Feb 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
action/no-benchmark Skips the action that runs the benchmark. area/p2p Related to the p2p networking system area/testing Related to any test or testing suite
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Very low test coverage of net/pb file(s)
3 participants