How do I stop sonar running tests?

2019-08-09 16:23发布

问题:

I'm looking at using Sonar to reduced the number of plugins I've had to install in Jenkins to get some decent code analysis (and sonar seems to do more and present it better). However when I kick of the sonar job the JUnit / Concordion tests are executed. I don't want these tests run as Jenkins is already executing the tests.

How do I stop the tests executing and just perform code analysis?

I've installed sonar 3.7.3 and executing using the Gradle sonar-runner plugin and specifying the :sonarRunner task.

回答1:

I'm just facing the same issue and it seems that you can run :sonarqube -x test to avoid having tests run before.



回答2:

You can set the sonar.dynamicAnalysis property to false. This will skip tests and only perform the static analysis part.

See http://docs.codehaus.org/display/SONAR/Analysis+Parameters#AnalysisParameters-OptionalParameters



标签: sonarqube