how to fail a scan in sonarqube when the coverage % goes down from previous scan

55 views
Skip to first unread message

ramdas.x.sivar...@nielsen.com

unread,
May 15, 2018, 2:22:01 PM5/15/18
to SonarQube
Hello,

I am wondering if there any way to fail a scan in sonarqube when the coverage % goes down from the previous scan.  
Ex: Coverage 
Yesterday - 40% 
Today - 30%
In some case, developers comment out the unit tests in case of failure to stop the build from failing.

Thanks in advance.

G. Ann Campbell

unread,
May 15, 2018, 3:29:26 PM5/15/18
to SonarQube
Hi,

Sorry, there's no good way to do this. Instead, I'd make sure Coverage on New Code was included in the Quality Gate, and look at test-related rules such as S1607 (Tests should not be ignored). Of course, that doesn't help if they comment-out the test rather than marking it ignored. For that, I hope that S125 (Sections of code should not be commented out) will soon apply to tests.


Ann
Reply all
Reply to author
Forward
0 new messages