In our SonarCloud project, we see, “A few extra steps are needed for SonarCloud to analyze your code coverage.” This is because our developers have not written any unit tests. However, the quality gate still shows as “Passed,” which allows our CI pipeline to pass and push the code to higher environments. Is there some condition I’m missing to configure in the quality gate?
Hi,
Welcome to the community!
Are you passing coverage reports into analysis? Or are you waiting to set that up until the developers write some tests?
I believe this is what happens when you simply omit coverage reports from analysis.
Ann
Hi Ann,
Thank you for the warm welcome!
The developers write unit tests and the coverage report is generated as part of the unit test step. It is expected to fail the quality gate when no unit tests are written, as this would result in the absence of a coverage report. right?
Best Regards,
Achu
Hi Achu,
The presence of unit tests doesn’t automatically guarantee that a coverage report is a) generated and b) fed into analysis.
Can you check your pipeline to make sure those things are happening?
Ann