How can I publish results and coverage of Javascript (Jasmine + Karma) tests in Sonar. Java test execution and coverage are fine. I am trying to add the tests for Javascript executed by Karma (lcov coverageReporter + sonarQubeUnitReporter).
- What Sonar properties (e.g., sources, inclusions, tests, test.inclusion, sonar.javascript.lcov.reportPath) should I define?
- In which pom (multi-module pom or submodule pom)?
- To what values must these properties be set?
I want to be reported in Sonar:
- Execution of Javascript tests;
- Coverage for these tests;
- The link to the Javascript source code (No “Test execution data ignored for n unknown files” message).
my-multi-modules-project
|-- a_module-project
| |-- child.pom
| |-- src/
| | |-- main/
| | | |-- java/
| | | |-- javascript/
| | | | |-- com/mycompany/project/javascript/
| | | | | |-- totest.js
| | | |-- resources/
| | |-- test/
| | | |-- java/
| | | |-- javascript/
| | | | |-- com/mycompany/project/javascript/
| | | | | |-- specs/
| | | | | | |-- mytest.spec.js
| | | | | karma.conf.js
| | | |-- package.json
| |-- target/
| | |-- surefire-reports/
| | |-- test-results/
| | | |-- lcov.info
| | | |-- sonarQubeUnitReporter.xml
|-- root.pom
|-- target/
Versions:
jasmine 2.99.0
Java 1.8
karma 1.7.1
karma-coverage 1.1.2
Maven 3.5.4
node 7.5
npm 3.0
sonarqube-unit-reporter 0.0.18
SonarQube 7.4