After configuring the project in the SonarQube built the code and ran the below instructed commands but still i am seeing 0% coverage infact we have around 60+%
Code: c#
Version: .NET6
Sonar Edition: Developer / Community / Enterprise
dotnet sonarscanner begin /k:"<sonar-project-key>"
/d:sonar.token="<sonar-token>"
/d:sonar.cs.opencover.reportsPaths=coverage.xml
dotnet build --no-incremental
coverlet .<replaced with my project test dll path>
--target "dotnet"
--targetargs "test --no-build"
-f=opencover
-o="coverage.xml"
dotnet sonarscanner end /d:sonar.token="<sonar-token>"
during the scan I see this message
INFO: ‘sonar.coverage.jacoco.xmlReportPaths’ is not defined. Using default locations: target/site/jacoco/jacoco.xml,target/site/jacoco-it/jacoco.xml,build/reports/jacoco/test/jacocoTestReport.xml
I am able to see the results in this format on the Command prompt but unable to see this results in sonar
Calculating coverage result…
Generating report ‘D:\sources\repos\xxxxxxxapi\coverage.xml’
±---------------------------------±-------±-------±-------+
| Module | Line | Branch | Method |
±---------------------------------±-------±-------±-------+
| APP.Accessors | 7.55% | 8.33% | 3.96% |
±---------------------------------±-------±-------±-------+
| APP.Common | 57.87% | 17.56% | 45% |
±---------------------------------±-------±-------±-------+
±--------±-------±-------±-------+
| | Line | Branch | Method |
±--------±-------±-------±-------+
| Total | 17.43% | 48.14% | 59.42% |
±--------±-------±-------±-------+
| Average | 37.27% | 46.32% | 40.7% |
±--------±-------±-------±-------+
Question is, am i missing any configuration?