Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Setting codecov patch target to a fixed number

codecov allows you to specify a total coverage target and it also allows codecov/patch. The patch check however attempts to enforce that the patch coverage is atleast at current master's coverage. i.e. if total coverage target is 80% and if current master coverage is 84%, the patch coverage needs to be atleast 84%. I understand the rationale behind this, that codecov is not allowing the total coverage to regress...

My question is this - Is there a way at all to specify a fixed target for the patch coverage ? For e.g., let's say I want to set my patch coverage target to a fixed 80% as well, is there any way at all to do that ? Thanks in advance.

like image 307
Omprakaash Avatar asked Aug 01 '18 14:08

Omprakaash


People also ask

What is Codecov coverage?

Codecov is a code analysis tool with which users can group, merge, archive, and compare coverage reports. Code coverage describes which lines of code were executed by the test suite and which ones were not. However, this is not to be confused with a testing tool.

How do I get Codecov badge?

You can get a link to your badge by going to Settings in codecov.io, selecting Badge from the right-hand side, and copying the Markdown link.


1 Answers

Yes, the documentation is here: https://docs.codecov.io/docs/commit-status

You can create a .codecov.yml file at the root of the project with the following:

coverage:
  status:
    patch:
      default:
        target: 80%
like image 59
KPLauritzen Avatar answered Sep 28 '22 03:09

KPLauritzen