Codecov is a service for analyzing code coverage by tests, which integrates with CI/CD and shows which part of the code is actually executed during testing. The service has two main metrics: patch and project coverage. They are different, and it is important to understand this in order to correctly assess the results in pull requests.
ΠΡΠΈΠΊΠ»Π°Π΄ ΠΏΠΎΠΊΠ°Π·Π½ΠΈΠΊΠ° ΠΏΠΎΠΊΡΠΈΡΡΡ Codecov Patch
What is Patch coverage?
Patch coverage is the coverage of tests only for those lines of code that have been changed in a specific PR. That is, if you added or modified several methods, Codecov will show how well these changes are covered. This helps to focus on the quality of new or updated parts of the code.
What is Project coverage?
Project coverage is the overall picture. It shows the percentage of test coverage for the entire project on the current branch. Even if the changes in the PR are well covered by tests, if there are few tests overall in the project, this metric will be low.
Therefore, ideally, it is worth monitoring both metrics: so that the new code has good patch coverage and does not worsen the overall project coverage.