fix: Improve code coverage reporting in codecov #2715
Merged
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.
This PR makes some small tweaks to code coverage reporting in codecov.
We don't need to provide
github.com/coder/coder/codersdk
explicitly as coverpkg since we're already passing all packages via./...
. In.vscode/settings.json
this was set to./.
which didn't match any package => changed to./...
.When viewing the reports on codecov.io I noticed that some lines that should be covered, were not. I believe this stems from us uploading short coverage reports from the mock database run. It should be sufficient to only upload from the postgres test. The downside is that it's the flakier test, so it might take a while before the coverage can be observed.This is actually most likely due to the postgres test failing so often.Finally, the
*test
packages where added to coverage ignore. Although, thanks to-coverpkg=./...
they have great coverage, but I don't think it's a meaningful metric for us to include (they're essentially test code in public packages).Side note: I realized codecov reports lines covered whereas go reports statements, I believe this is a reason our coverage appears worse on codecov than reported by
go test -cover
.