I run the scanner with the option /d:sonar.dotnet.excludeTestProjects=true but after analysis I can see tests as part of new code, uncovered lines. The class is marked as a [TestFixture], methods are marked with [Test]. What am I missing?
We are using:
SonarQube Enterprise Edition Version 9.9 (build 65466)
If you go to the code tab, you will see which projects are recognized as test projects: these have no code coverage, instead —.
If SonarQube make mistakes in detecting if a project is a the test project (in general based on your settings in SonarQube), you can give the analyzer an indication in the csproj file: