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

Not getting coverage report in sonarqube #16

Closed Sjnahak closed 3 years ago

Sjnahak commented 4 years ago

I used the mule-sonarqube-plugin but not getting any coverage report sonarqube version :7.9.4

I can see coverage from munit :

[INFO] ===============================================================================
[INFO] MUnit Coverage Summary
[INFO] ===============================================================================
[INFO]  * Resources: 22 - Flows: 115 - Processors: 758
[INFO]  * Application Coverage: 78.36%
[INFO] ====================================================================================
[INFO] MUnit Run Summary - Product: MULE_EE, Version: 4.2.2-hf2
[INFO] ====================================================================================
[INFO]  >> test-suite.xml test result: Tests: 109, Errors: 0, Failures: 0, Skipped: 0
[INFO]
[INFO] ====================================================================================
[INFO]  > Tests:        109
[INFO]  > Errors:       0
[INFO]  > Failures:     0
[INFO]  > Skipped:      0

ERROR

INFO  2020-10-19 16:45:16,745 [main] org.mule.munit.remote.coverage.CoverageManager: Shutting down coverage server
ERROR 2020-10-19 16:45:16,746 [pool-4-thread-1] org.mule.munit.plugins.coverage.server.CoverageServer: Failed to start Coverage Server in port 50361
INFO  2020-10-19 16:45:16,746 [main] org.mule.munit.remote.coverage.CoverageManager: Calculating application coverage
INFO  2020-10-19 16:45:16,822 [main] org.mule.munit.remote.RemoteRunner: Done

Any hints?

fperezpa commented 3 years ago

Hi, Do you get the json reports after running the tests?. The plugin reads from that files. In mule 3 it reads, "/target/munit-reports/coverage-json/report.json" In mule 4 it reads, "/target/site/munit/coverage/munit-coverage.json"

Sjnahak commented 3 years ago

Thanks @fperezpa , My bad forgot to update here the issue is fixed after updating my sonar installation path

Muppalla-Ramaraju commented 3 years ago

Hi @Sjnahak, Can you please let me know where you updated the path?

Sjnahak commented 3 years ago

@Muppalla-Ramaraju

  1. In git at root where sonar-project.properties file is updated sonar.coverage.mulesoft.jsonReportPaths=./target/site/munit/coverage/munit-coverage.json

  2. In the Jenkins build agents the sonar scanner path eg /opt/sonarscanner/sonar-scanner-4.4.0.2170-linux