Hi we are using sonarqube develop 7.5 version.
Two of our project recently are failed for new code coverage is 0.
But we only updated the library version number, no new code at all.
From the overview, coverage on new code shows ‘-’ , but Quality Gate turned to red as ‘failed’ .
Is this the expected behavior or there is a bug ?
Looking forward to your help!
I attached the screeshots. This is one of our library, we only update version number this time (1.2.29 -> 1.2.30) . No new code check in at all, but quality gate still try to detect new code coverage and status is failed.
Also found another project we just checked in new code, in the overview page, quality gate is failed for the coverage number is incorrect. The real new code coverage is 93.2 which line coverage is 94.7% and condition coverage is 83.3%. But quality gate shows 1.4% and 2.7% respectively.
It’s like you read my mind. Your 2nd update added exactly the screenshot I was about to ask for after reading your first.
I suspect I might know what’s going on here. How about a screenshot of your Quality Gate conditions?
I ask because there is a difference between a condition on the metric “Coverage on New Code” and one on the metric “Coverage” with the “on new code” (IIRC) checkbox checked.
BTW, your OP said you’re on 7.5. The current version and new LTS is 7.9.1. The changes between the two versions include simplifying Quality Gate configuration to eliminate the “on new code” checkbox and migrate any existing conditions. Even without this problem you should consider upgrading at your earliest convenience.
I unchecked the ‘on new code’ in both ‘coverage’ and ‘condition coverage’ and only use ‘Coverage on New Code’ to track the new code quality. Looks like fix the issue!
I was facing the same Sonar Qube 0% code coverage problem for version 7.4 for a couple of days and visited this link.
Thanks to @nemo & @ganncamp - Your inputs really helped and resolve the issue (where I need to uncheck “on new code” for the metrics)
This post had lain dormant for more than 2 years before you resurrected it. Please don’t do that. Please create a new thread with all the details of what you’re experiencing.