Closed ashishbhatt-afk closed 1 week ago
@Bertk @daveMueller Would you guys be able to help here. I saw your few comments on a similar issue.
@ashishbhatt-afk I use the report from reportgenerator to identify the assemblies and classes which should be excluded.
I have doubts using [*.Tests?]*
. Please use assembly names instead
<Exclude>[typename1]*, [typename2]*</Exclude>
<ExcludeByFile>**/IRISElementsBookkeeping/*.cs</ExcludeByFile>
example from Coverlet CI https://github.com/coverlet-coverage/coverlet/blob/cf40840873588e3b596eebc25362732728b3d651/eng/build.yml#L33
I'm running into similar issues. I created an issue here with my findings #1695
From what I found, the generated report that you specified under CoverletOutput
is not using the runsettings
file properly. Until this gets fixed, you could manually add the exclusions using the property /p:CoverletOutput=...
I believe.
The VSTest integration with coverlet.collector uses the .runsettings file (see VSTestIntegration.md)
You are using coverlet.msbuild which only supports MSBuild properties.
- task: DotNetCoreCLI@2
displayName: 'Run Tests and Collect Coverage'
inputs:
command: 'test'
projects: '**/*Tests.csproj'
arguments: '--configuration $(BUILD_CONFIGURATION) --no-build /p:CollectCoverage=true /p:CoverletOutputFormat=cobertura /p:CoverletOutput=$(COVERAGE_DIRECTORY)/ --settings "demo.runsettings"'
publishTestResults: true
I am trying to exclude few files from code coverage but I cant do it.
Below is my runsettings file:
Below is my YAML:
Please help.