We’re setting up a Jenkins parallel pipeline build to execute our tests across multiple executor nodes to reduce the time it takes to run the full test suite. After the parallel tests have completed the pipeline consolidates the results on one node to generate the test reports. At this point we also attempt to run the Gradle SonarQube plugin to perform static analysis and upload the test results & coverage data to SonarCloud.
Apparently the Gradle SonarQube task is declaring test execution as a prerequisite tasks, causing a second sequential execution of our tests. Is there a way we can suppress the Gradle plug-in’s attempt to re-execute the tests? This pretty much defeats the purpose of running the tests in parallel.
I know this is a bit late, but if you are still using SonarScanner for Gradle 2.6.0, try this: ./gradlew clean build sonarqube -x test where the -x will skip the test dependency.
References for the workaround:
But…
In SONARGRADL-59, this issue is fixed in SonarScanner for Gradle 3.0. So try upgrading to 3.0 and testing it. More details with the scanner here.