Reputation: 1064
I am executing Gradle SonarRunner task on my Android code as a part of Team City build.
It fails Quality Gate on SonarQube, but console build is successful and there is no info about failed QG in logs:
[10:57:35][Step 1/3] 10:57:36.323 INFO - Loaded quality gate 'Android'
[10:57:36][Step 1/3] 10:57:36.397 INFO - Compare to previous analysis (2015-12-07)
[10:57:36][Step 1/3] 10:57:36.405 INFO - Compare over 30 days (2015-11-08, analysis of Thu Nov 26 13:27:50 CET 2015)
[10:57:36][Step 1/3] 10:57:36.411 INFO - Compare to previous version (2015-12-07)
[10:57:36][Step 1/3] 10:57:36.642 INFO - Execute decorators...
[10:58:19][Step 1/3] 10:58:20.189 INFO - Store results in database
[10:58:59][Step 1/3] 10:59:00.330 INFO - Analysis reports generated in 2698ms, dir size=4 MB
[10:59:09][Step 1/3] 10:59:09.888 INFO - Analysis reports compressed in 9558ms, zip size=3 MB
[10:59:09][Step 1/3] 10:59:10.245 INFO - Analysis reports sent to server in 357ms
[10:59:09][Step 1/3] 10:59:10.245 INFO - ANALYSIS SUCCESSFUL, you can browse [###############]
[10:59:09][Step 1/3] 10:59:10.245 INFO - Note that you will be able to access the updated dashboard once the server has processed the submitted analysis report.
[10:59:10][Step 1/3] INFO: ------------------------------------------------------------------------
[10:59:10][Step 1/3] INFO: EXECUTION SUCCESS
[10:59:10][Step 1/3] INFO: ------------------------------------------------------------------------
[10:59:10][Step 1/3] Total time: 6:05.725s
[10:59:10][Step 1/3] Final Memory: 44M/1294M
[10:59:10][Step 1/3] INFO: ------------------------------------------------------------------------
[10:59:10][Step 1/3]
[10:59:10][Step 1/3] BUILD SUCCESSFUL
I'd like to recognize such event by failing Gradle task or at least checking logs for some specific failure message (eg. "ANALYSIS FAILED"). How can I achive this?
Upvotes: 2
Views: 2067
Reputation: 1073
After Sonarqube 7.7 the build breaker does not seem to work anymore.
Since 1.3.0, this Android Gradle plugin has build breaker capabilities, you might want to check it out: https://github.com/pinchbv/android-analyzer
Upvotes: 0
Reputation: 22794
You don't mention your SonarQube Server version. Breaking the build is not available in the current server version, 5.2, but was there in v5.1 and before with the Build Breaker Plugin, and native support should return soon.
Upvotes: 3