jstanley
jstanley

Reputation: 2097

"Resource not found" trying to add junit tests into sonarqube

I am trying to associate junit test results with SonarQube.

Here is what I have for Sonar Properties:

sonar.projectKey=FXX
sonar.projectName=FUTURE_Jason
sonar.projectVersion=12.9.0
sonar.sourceEncoding=UTF-8
sonar.sources=src
sonar.tests=test-build/junit/classes/
sonar.junit.reportsPath=test-build/junit/reports

When executing a Jenkins job associated with SonarQube, I am receiving the following warnings:

13:52:12.923 INFO  - Sensor SurefireSensor
13:52:12.924 INFO  - parsing /var/lib/jenkins/jobs/FUTURE_SONAR_Jason/workspace/test-build/junit/reports

13:52:13.472 WARN  - Resource not found: msc.rc.model.AbstractTrackingUpdateTest

In the Jenkins workspace I have the directory test-build and it includes both the reports and classes.

$ ll /var/lib/jenkins/jobs/FUTURE_SONAR_Jason/workspace/test-build/junit/classes/msc/rc/model/AbstractTrackingUpdateTest.class
-rwxr-xr-x 1 build build 9590 Dec 14 14:39 /var/lib/jenkins/jobs/FUTURE_SONAR_Jason/workspace/test-build/junit/classes/msc/rc/model/AbstractTrackingUpdateTest.class

Any idea what I am missing?

Upvotes: 2

Views: 4928

Answers (1)

jstanley
jstanley

Reputation: 2097

I changed the sonar.tests property to point to the .java files, problem is now resolved.

Upvotes: 2

Related Questions