Open cliffAtOsaic opened 1 month ago
@fhnaseer plese help here if you can :)
@cliffAtOsaic <Include>/<Exclude>
are regex patterns. Can you please check if your source path/module path match patterns provided in runsettings?
If it still persists, then can you please provide a small repro solution?
@cliffAtOsaic
<Include>/<Exclude>
are regex patterns. Can you please check if your source path/module path match patterns provided in runsettings? If it still persists, then can you please provide a small repro solution?
Just seeing this; not sure why I didn't get an email. I'll take a look at this tomorrow and post what I learn. Thanks!
Description
Cannot exclude auto-generated code from code coverage with .runsettings file.
We are importing ElasticSearch which generates code under the path "/_/src/Elastic.Clients.Elasticsearch/_Generated" which is then deleted after the build is complete. (I cannot find this code when I search; we have no src and no _Generated directories.)
In our .runsettings file, I have tried multiple ways to exclude the ElasticSearch DLLs and the ElasticSearch generated code with negative results.
Steps to reproduce
What steps can reproduce the defect?
dotnet-coverage collect -f cobertura,coverage "dotnet test --logger trx" -s .\.runsettings
Expected behavior
Auto-generated source code under the "src" and/or "_Generated" directories are excluded from code coverage.
Actual behavior
All auto-generated source code under the "src" and/or "_Generated" directories is included with code covaerage.
Diagnostic logs
log.txt
Environment
Windows 11 Version 23H2 (OS Build 22631.3447) dotnet --version = 8.0.204