1

I am using Karma Test Runner on my JavaScript project to generate a Unit Test Report (target/surefire-report/TESTS-karma.xml) but I am unable to make SonarQube import this by setting 'sonar.dynamicAnalysis' to 'reuseReports'.

I configured my Maven POM as follows:

<sonar.language>js</sonar.language>
<sonar.inclusions>app/**,astCommon/**</sonar.inclusions>
<sonar.dynamicAnalysis>reuseReports</sonar.dynamicAnalysis>     
<sonar.javascript.jstest.reportsPath>target/surefire-reports</sonar.javascript.jstest.reportsPath>
<sonar.javascript.jstestdriver.reportsPath>target/surefire-reports</sonar.javascript.jstestdriver.reportsPath>
<sonar.junit.reportsPath>target/surefire-reports</sonar.junit.reportsPath>
<sonar.surefire.reportsPath>target/surefire-reports</sonar.surefire.reportsPath>

(I guess "sonar.javascript.jstest.reportsPath" is the right property but just to be sure I did include some other properties as well)

What also surpises me is that I do not get a warning when I enter an incorrect path in 'sonar.javascript.jstest.reportsPath'. I kind of expected 'Reports path not found'. This makes me suspect that SonarQube somehow is not aware that it should reuse the existing report.

Any hint is appreciated.

Thanks and best, Ronald

4
  • 2
    I looked at the code of the JavaScript plugin version 1.5 and could see that the JsTestDriverSensor.class and JsTestSensor.class were removed. I guess this is the result of jira.codehaus.org/browse/SONARPLUGINS-3408. Now I am pretty confused. Somebody has to explain to me why one would not want to import unit test reports.
    – Ronald
    Jan 31, 2014 at 15:00
  • 1
    What the heck were they thinking? Agreed. Feb 25, 2014 at 14:09
  • 2
    hi.. were you able to fix this? I have same problem and those properties doesn't seem to work.. I can see code coverage but not the JUNIT unit test report generated by Karma
    – iRamesh
    Jun 16, 2014 at 20:34
  • 1
    It looks like jira.codehaus.org/browse/SONARJS-239 (Re-introduce import of unit test result) was resolved on 06/Nov/14. Nov 18, 2014 at 20:00

0

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Browse other questions tagged or ask your own question.