-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sonar generic test report - file path issue with SQ 7.9 #44
Comments
I had the same issue and was able to work around the issue by using the |
It looks like that
|
Thanks @gfortaine , You make my day. |
Thanks a lot @gfortaine sonarQubeUnitReporter: {
sonarQubeVersion: "9.x",
outputFile: "./coverage/unit-test-result.xml",
overrideTestDescription: true,
testFilePattern: ".spec.ts",
useBrowserName: false,
prependTestFileName: __dirname
} |
As a part of the drop of modules on the SonarQube side (https://jira.sonarsource.com/browse/MMF-365) in SonarQube v7.6, the generic coverage/test reports sensors were changed to be global sensors (https://jira.sonarsource.com/browse/SONAR-11530), meaning they only run once for the project (and not for each module). To address this, we need to provide the paths to all generic execution reports to sonar.testExecutionReportPaths at the root level of the project. In the case of a multi-module project, we have the generic test report using this karma-sonarqube-unit-reporter being generated inside a javascript module and the file path of the test files inside the results xml file is all relative to that module. This does not work.
These test file paths need to be relative to the root folder or absolute file paths, otherwise the generic test execution sensor running at the root level is unable to recognize these files.
The text was updated successfully, but these errors were encountered: