[GRADLE-3005] SonarRunner doesn't report tests to SonarQube instances using Java Ecosystem 1.5+ Created: 23/Jan/14  Updated: 14/Sep/16  Resolved: 14/Sep/16

Status: Resolved
Project: Gradle
Affects Version/s: None
Fix Version/s: 1.12

Type: Bug
Reporter: Gradle Forums Assignee: Unassigned
Resolution: Fixed Votes: 3


 Description   

The SonarRunnerPlugin is currently passing the path to JUnit reports using the `sonar.surefire.reportsPath` property:

File testResultsDir = project.test.reports.junitXml.destination
properties["sonar.surefire.reportsPath"] = testResultsDir.exists() ? testResultsDir : null

With the [Java Ecosystem 1.5 plugins]([1]http://jira.codehaus.org/browse/SONAR...) they removed that property (which was deprecated) in favor of `sonar.junit.reportsPath`.

I propose that the code be modified to set both properties, in order to provide compatibility for both sets of SonarQube users.

File testResultsDir = project.test.reports.junitXml.destination
properties["sonar.surefire.reportsPath"] = testResultsDir.exists() ? testResultsDir : null
properties["sonar.junit.reportsPath"] = testResultsDir.exists() ? testResultsDir : null

----------------------------------------------------------------------------------------
[1] http://jira.codehaus.org/browse/SONARJAVA-301



 Comments   
Comment by Gradle Forums [ 23/Jan/14 ]

FYI, this results in SonarQube thinking you have 0 unit tests.

Generated at Wed Jun 30 12:37:19 CDT 2021 using Jira 8.4.2#804003-sha1:d21414fc212e3af190e92c2d2ac41299b89402cf.