Coverage Information


We are trying to configure code coverage and we are not able to see the information within a branch other than the master. as you can see below it does not display the information, see bellow

This information is also not sent to github, see below.


From the screenshot you shared, I believe there is no added lines in the branch “test_coverage” so here is why you don’t see any coverage data.

I suggest you to try to add some new lines compared to the main branch and see if SonarQube detects them as not covered.


1 Like

We did a test where we removed the coverage code which caused the coverage to decrease, and even then we didn’t identify it.
For example, we had an initial coverage of 100% and reduced it to 97.8% (see the print).
Shouldn’t this action alert and calculate the new coverage?

The Coverage on New Code is 'NULL" because there is no new code (you removed some code but nothing has been added). Still, SonarQube estimates that if you merge this branch you will get an estimated coverage of 97.8%. That will become your new baseline if you merge that branch.
There is no alert, ie the Quality Gate is still green/passed because the future new coverage baseline of 97.8% is still higher than the 80% expected by the default Quality Gate configuration.

I’m guessing what you are trying to achieve is to have a Failed Quality Gate if the coverage is decreasing. I believe you can achieve that by changing the default Quality Gate configuration and expect more than the 80% and why not 100% because you achieved it and you don’t want any commit to decrease this.

1 Like