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

another sample of use to README file #7

Open mihaj opened 3 years ago

mihaj commented 3 years ago

I am adding an additional sample, which I use. If you like it accept it :).

mihaj commented 3 years ago

Dockerfile needs some testing IMO. Let me know if you would like to do it differently. I've tried the 5.0 base image, and there are some issues with installing JDK. I can look into it tomorrow.

mihaj commented 3 years ago

I've removed the a Dockerfile changes since someone else will PR those changes.

highbyte commented 3 years ago

Thanks for example. Probably not a bade idea to have a complete example. Before I'll add anything I'll look into the differences between the test arguments in your example and mine.

I use the following packages related to testing

  Microsoft.NET.Test.Sdk
  xunit
  xunit.runner.visualstudio
  coverlet.collector

and use the test arguments --logger trx --collect:"XPlat Code Coverage" -- DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.Format=opencover

While you have these test packages (+ others like xunit or nunit?)

  coverlet.msbuild
  coverlet.collector

and use the test arguments /p:CollectCoverage=true /p:CoverletOutputFormat=opencover

Probably achieves same thing in different ways.

mihaj commented 3 years ago

I use xUnit yes. I do not collect any TRX files, just run the tests, and measure the coverage. Only coverage percentages are shown in the Sonarqube.

But I'll try to import TRX to Sonarqube by combining it with your example.