How to create a status check on Github for lines not covered by test?

66 Views Asked by At

is there any way how to create a status check that will fail when some test is missing for added line? I am getting this warning by Codecov now, but I want to block merge every time when test is missing. I am also using CircleCi as an integration service. Thanks for help :)

1

There are 1 best solutions below

0
VonC On

You can try and integrate CircleCI and Codecov (from Tom Hu, Developer Relations Lead at Codecov), in order to use the Codecov orb on the CircleCI config.

Thant would allow to, for instance on GitHub, define a new status check on the branch protection and add a friendly report bot.
Add the status check by accessing again to the projects settings, and add the new tick:

https://uploads-ssl.webflow.com/5f3fdb4ac2968afe2a89c98b/5f4d21b75cf2fb31cd7a604e_1_gLMQ5i9M4A7IDNvRD5eNNw.png

That triggers the installation of the Codecov bot:

https://uploads-ssl.webflow.com/5f3fdb4ac2968afe2a89c98b/5f4d21fb3ac1cbd79163d9f5_1_SWpLYbT081xw8iFZvKnobg.png

And for a certain threshold, it will mean the status check will fail and block the merge:

threshold -- https://uploads-ssl.webflow.com/5f3fdb4ac2968afe2a89c98b/5f4d2226f87cc462e29b5e83_1_pvyAaoSRbjYoX6AqxTXumw.png

Result:

failed check -- https://uploads-ssl.webflow.com/5f3fdb4ac2968afe2a89c98b/5f4d223ab9c0042755846d76_1_kQeST256aAF0KBWK-MNuPg.png


For pure CircleCI pipelines, you also have condition steps and workflows.
Said pipeline can send tests result to Codecov, as seen in "Setting up a CI pipeline with CircleCI" from Fabio Gallotti.