-
Notifications
You must be signed in to change notification settings - Fork 64
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
Add codecov step in CI and add badges to README #20
Conversation
Codecov Report
@@ Coverage Diff @@
## main #20 +/- ##
=======================================
Coverage ? 88.52%
=======================================
Files ? 52
Lines ? 7593
Branches ? 0
=======================================
Hits ? 6722
Misses ? 734
Partials ? 137 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
f3686bb
to
d659714
Compare
d659714
to
24aa6b5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀
.codecov.yaml
Outdated
default: # context, you can create multiple ones with custom titles | ||
enabled: yes # must be yes|true to enable this status | ||
target: auto # specify the target coverage for each commit status | ||
# option: "auto" (must increase from parent commit or pull request base) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# option: "auto" (must increase from parent commit or pull request base) | |
# option: "auto" (must not decrease from parent commit or pull request base) |
Right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, actually I found out that we can do auto
with a threshold
https://docs.codecov.com/docs/commit-status and I have set this to be 5%, meaning that the coverage cannot drop more than 5% (to also allow some flakiness).
Let me know if you think we should be stricter about this :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SGTM!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, can we make the threshold drop 1-2%. Given the size of the codebase, coverage going down by 5% can easily be a pretty huge PR with no tests. No need for me to re-stamp, though.
This PR adds a codecov step in CI configs and add the corresponding badges to README. We have also added a config file for codecov to fail PRs if the coverage decreases (experimental, we can revert / disable it if it gets too annoying in the future)
In #20, we added Codecov integration by configuring the `project` rule to require overall project coverage to not decrease by more than 1% for every new PR. However, by default, Codecov configures two checks: `project` and `patch`. We were using the defaults for `patch`, which checks the coverage of the new lines in the PR. After internal discussion, we are choosing to disable `patch` level checking, for two reasons: 1. Flakiness around detecting "new code" in a PR in the presence of refactorings and code motion 2. To allow for small changes as part of a PR stack which e.g. add a new interface/type before implementing the corresponding functionality to be tested. We expect that, by default, most PRs will be gated by the `project` check, and that coverage will increase over time given the restrictions on reducing coverage. If this turns out to not be true over time, we can always make one or both of these checks stricter.
This PR adds a codecov step in CI configs and add the corresponding badges to README.
We have also added a config file for codecov to fail PRs if the coverage decreases (experimental, we can revert / disable it if it gets too annoying in the future)