highbyte / sonarscan-dotnet

GitHub Action SonarCloud/SonarQube scanner for .NET 8/7/6/5 and .NET Core applications with pull request decoration support
https://github.com/marketplace/actions/sonarscan-dotnet
MIT License
36 stars 24 forks source link

Coverage won't be analyzed ? #9

Closed renepanke closed 3 years ago

renepanke commented 3 years ago

So hello again,

I'm that guy again :D

Subjecting my Repository Jobb again. So as I can see the fetch depth is set to 0

`steps:

Wouldn't that mean, that the tests inside JobbTest should be analyzed too and there should be a coverage on the sonarcloud project?

highbyte commented 3 years ago

Setting fetch-depth to 0 disables git shallow clone, which will enable some functionality in SonarQube/SonarCloud. It's optional, see here: https://github.com/highbyte/sonarscan-dotnet#sonarqubesonarcloud-dashboard-warning-shallow-clone-detected-during-the-analysis

It shouldn't effect code coverage. To collect code coverage in a format that SonarQube/SonarCloud understands, see example by using Coverlet here https://github.com/highbyte/sonarscan-dotnet#include-code-coverage-with-coverlet

renepanke commented 3 years ago

As you can see in my SonarScan Pipeline i added the exact lines but still no coverage to see in the SonarCloud project.. any ideas ?

In the output you can clearly see that the pipeline is indeed testing..

pipeline-output

Here are the logs.

Well, I found this: 2020-12-07T16:40:05.6841535Z 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 2020-12-07T16:40:05.6852920Z INFO: No report imported, no coverage information will be imported by JaCoCo XML Report Importer

Well, turns out, it's my bad again.. so it wasn't clear that the sonarBeginArguments were supposed to be with it. Sorry for taking some of your time. Issue can be closed.

Thanks for the quick help again ! 👌😎

highbyte commented 3 years ago

No problem!