Cannot exclude tests in runsettings when using VSTest integration driver
See original GitHub issueHi! We are using the VSTest integration driver (v1.2.0) to successfully generate a coverage.covertura.xml. Integrated it with MS DevOps, everything looks great. Now we want to exclude some files from our test report and we can’t seem to get it to work.
We are running as follows:
dotnet test --collect:"XPlat Code Coverage" --settings .\coverlet.runsettings
and
dotnet test --settings .\coverlet.runsettings
.
We’ve tried many runsettings file configuration, but in its simplest form we think something like this should work:
<?xml version="1.0" encoding="utf-8" ?>
<RunSettings>
<DataCollectionRunSettings>
<DataCollectors>
<DataCollector friendlyName="XPlat Code Coverage">
<Configuration>
<Format>cobertura</Format>
<Exclude>[*]*</Exclude>
</Configuration>
</DataCollector>
</DataCollectors>
</DataCollectionRunSettings>
</RunSettings>
We have gotten file exclusion to work with the MSBuild integration driver, using the following command:
dotnet test /p:CollectCoverage=true /p:Exclude="[*]*"
Issue Analytics
- State:
- Created 3 years ago
- Comments:6
Top Results From Across the Web
Cannot exclude tests in runsettings when using VSTest ...
Hi! We are using the VSTest integration driver (v1.2.0) to successfully generate a coverage.covertura.xml. Integrated it with MS DevOps, ...
Read more >Configure unit tests by using a .runsettings file
In the IDE, select Test > Configure Run Settings > Select Solution Wide runsettings File, and then select the .runsettings file. This file ......
Read more >xml - .runsettings - Exclude All files with 'test'
I am trying to run a build with tests using the .runsettings file in VS 2017 and I want to exclude all the...
Read more >QA – DTan's Blog
Continuous Integration in VSTS using .Net Core (with Code Coverage), ... Use a test .runsettings file to exclude assemblies you don't want to...
Read more >Most Complete MSTest Framework Tutorial Using .Net Core
Learn about the MSTest Framework using .Net Core in Selenium C# and the aspects related to cross browser testing and parallel testing in ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi @mrcoymeeks you should add namespaces with a comma
,
like in the documentation sample https://github.com/coverlet-coverage/coverlet/blob/master/Documentation/VSTestIntegration.mdThank you for your prompt response Marco. We added the logging flag and the exclusion started working as expected right away. Very strange, but most welcome! I’m sure we did something wrong before but I have no idea what. I’ll close this for now and if we detect the issue again I’ll post it here.
Thanks again!