Patch Coverage

What is patch coverage?

Patch coverage is code coverage of the changed lines in your pull request. It is specifically tied to the code you just changed and does not indicate the overall coverage of a file or your repo. The advantage of focusing on patch coverage is that if you maintain a high level of patch coverage on every commit, your overall project coverage will increase over time.

How do we determine what makes up patch coverage?

Codecov looks at your git diff and then tracks the coverage of the lines within that diff, you'll sometimes see it referred to as "diff coverage." This means patch coverage is the simplest and most relevant info to you when you're making a change.

In the above Codecov comment there's a block quote at the top that contains two lines, the top line compares the project coverage from the 8925950 commit to the 11e2a1e commit and the bottom line indicates the diff is 100% covered. This means you've covered every line of coverable code you edited with a test ✅.

In the future if this happens, we'll minimize our noise for you and just let you know that you've covered everything and can move on from thinking about coverage in this PR.