Codecov — is a service for analyzing code coverage with tests that integrates with CI/CD and shows how much code is actually executed during testing. The service has two main indicators: patch i project coverage. They are about different things, and it is important to understand this in order to correctly evaluate the results in pull requests.
Приклад показника покриття Codecov Patch
What is Patch coverage?
Patch coverage <TAG1> is test coverage of only those lines of code that have been changed in a particular PR. That is, if you have added or changed several methods, Codecov will show how well these changes are covered. This helps focus on the quality of new or updated parts of the code.
What is Project coverage?
Project coverage <TAG1> is the big picture. It shows the percentage of test coverage of the entire project on the current branch. If even changes in PR are well covered by tests, but in general there are few tests on the project, this indicator will be low.
Therefore, ideally, it is worth following both metrics: so that the new code has a good patch coverage and does not worsen the overall project coverage.