Correct way to disable test dependency

Hello!

I’m using sonarqube-gradle-plugin. My CI setup is:

  1. ./gradlew testDebugUnitTest
  2. ./gradlew jacocoReport
  3. ./gradlew sonar

At the moment the 3rd step runs tests once again (despite everything being run already, and reports having been generated). It is unwanted as it is a big project and tests run for ~30 min.

I found that tests can be disabled by running ./gradlew sonar -x test but I’m not sure if it is an official and recommended way of doing that (I want to make sure that I’m not losing some coverage data because of that).

Also, the follow-up question: is there a way to remove dependency both on test and androidTest tasks? I can see in logs that androidTest-related tasks are being executed as well.

Hi,

At the moment, what you’ve come to is our best recommendation. Because analysis needs both the .java files and the .class files, the sonar task depends on the earlier steps in the process.

 
HTH,
Ann

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.