Hi, can someone help me?
Sonar version: SonarQube version 9.3.0.51899
Project Language: c# (.netcore)
I´m trying to configure coverage exclusions on Project Settings → Analysis Scope.
When configured with only one pattern, sonar works fine.
When configured with more then one patter, sonar ignore all patern, even the one that works alone.
Example:
1: This configuration works fine:
Pattern used: **/NotFeature/*
Logs:
INFO: Base dir: C:\Users\lampa\source\repos\TesteSonarCoverage\TesteSonarCoverage
INFO: Source paths: Feature/HelloWorld.cs, NotFeature/JustClass.cs, Program.cs
INFO: Excluded sources for coverage: **/NotFeature/*
2: This configuration don´t work:
Pattern used: **/NotFeature/*, **/Program.cs
Logs:
INFO: Base dir: C:\Users\lampa\source\repos\TesteSonarCoverage\TesteSonarCoverageTests
INFO: Test paths: Feature/HelloWorldTests.cs, UnitTest1.cs, TestResults/3f660b67-...
INFO: Excluded sources for coverage: **/NotFeature/*, **/Program.cs
3: When excluded coverage options is used on “sonarscaner begin command”, everthing works as expected:
/d:sonar.coverage.exclusions="**/NotFeature/*, **/Program.cs"
Logs:
INFO: Base dir: C:\Users\lampa\source\repos\TesteSonarCoverage\TesteSonarCoverage
INFO: Source paths: Feature/HelloWorld.cs, NotFeature/JustClass.cs, Program.cs
INFO: Excluded sources for coverage: **/NotFeature/*, **/Program.cs
I pushed the project on git repository
fernandolamp/sonarcoverage: Temporary project to demonstrage a sonar bug (github.com)
What i´m doing wrong?