We are currently experiencing an interesting issue with the Sonarcloud. We noticed that for some classes even though an attribute for
[ExcludeFromCodeCoverage] is set the objects are taken into account for the coverage calculation.
Here an example
We noticed that the attribute is working for classes but it seems not to work for records. Are we on the right track? Is this a SonarCloud issue or an issue with our CI pipeline.
Template for a good new topic, formatted with Markdown:
- ALM used Azure DevOps
- CI system used Azure DevOps
- Languages of the repository: c#
- Error observed (wrap logs/code around with triple quotes ``` for proper formatting)
- Steps to reproduce:
dotnet test XXXX --configuration $(BuildConfiguration) --filter Type=UnitTest --logger "trx" /p:CollectCoverage=true /p:CoverletOutputFormat=opencover /p:Exclude="[*.Tests]*" /p:ExcludeByAttribute=Obsolete /p:ExcludeByAttribute=ObsoleteAttribute /p:ExcludeByAttribute=GeneratedCodeAttribute /p:ExcludeByAttribute=CompilerGeneratedAttribute /p:ExcludeByAttribute=ExcludeFromCodeCoverage /p:ExcludeByAttribute=ExcludeFromCodeCoverageAttribute