mulesoft-catalyst / mule-sonarqube-plugin

The Mule SonarQube Plugin provides the capability to do code inspecting and taking project metrics from a mule project using SonarQube.
The Unlicense
48 stars 69 forks source link

Unable to send code coverage to sonarqube #53

Closed brvaland closed 1 year ago

brvaland commented 1 year ago

Hello

I have setup sonarqube v8.9.10 LTS version on my machine and followed required configuration about intalling mule-sonarqube-plugin in extensions/plugin folder including rules-3.xml and rules-4.xml file but when i try to run mvn clean test sonar:sonar -Dsonar.host.url=http://localhost:9001 -Dsonar.sources=src/ -Dsonar.projectKey=helloworld-api -Dsonar.projectVersion=0.0.1

[ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:3.9.1.2184:sonar (default-cli) on project helloworld-api: Error during parsing of generic test execution report '/Users/***/Documents/helloworld-api/target/sonar-reports/MULE_EE.4.4.0-20221111.xml'. Look at the SonarQube documentation to know the expected XML format.: Line 2 of report refers to a file which is not configured as a test file: src/test/munit/helloworld-suite.xml -> [Help 1]

I have added property sonar.testExecutionReportPaths to pom.xml file - <sonar.testExecutionReportPaths>target/sonar-reports/MULE_EE.4.4.0-20211227.xml</sonar.testExecutionReportPaths> but no luck.

Reference: https://help.mulesoft.com/s/article/MUnit-Execution-Coverage-Report-cannot-be-pushed-to-Sonar

brvaland commented 1 year ago

I noticed in readme it did specify - "Coverage. To be able to see it, you need to configure json format in Munit Report. https://docs.mulesoft.com/munit/2.2/coverage-maven-concept"

I have removed sonar and added json all worked fine with Sonarqube 9.7-community.