Runsettings file failing with error "Data collection : Could not find data collector 'XPlat Code Coverage"
See original GitHub issueHi, I can successfully run coverlet in our build tests on Azure DevOps using netcore 2.2, but as soon as I try to use a runsettings file I get an error. Data collection : Could not find data collector ‘XPlat Code Coverage’
Im using a file based on what I saw in your point 2 of Known Issues to include the datacollector information, and have made sure we have upgraded our prerequisites. The full file is below.
<?xml version="1.0" encoding="utf-8"?> <RunSettings> <DataCollectionRunSettings> <DataCollectors> <DataCollector friendlyName="XPlat Code Coverage"> <Configuration> <CodeCoverage> <Functions> <Exclude> <Function>.*get_.*</Function> <Function>.*set_.*</Function> <Function>^CarWebServiceReference\..*</Function> </Exclude> </Functions> <ModulePaths> <Exclude> <ModulePath>.*framework.dll</ModulePath> <ModulePath>.*framework.model.dll</ModulePath> <ModulePath>.*framework.mvc.dll</ModulePath> <ModulePath>.*test.dll</ModulePath> <ModulePath>.*microsoft.windowsazure.storage.dll</ModulePath> <ModulePath>.*fluentassertions.dll</ModulePath> <ModulePath>.*fluentassertions.core.dll</ModulePath> <ModulePath>.*Moq.dll</ModulePath> <ModulePath>.*newtonsoft.json.dll</ModulePath> </Exclude> </ModulePaths> </CodeCoverage> </Configuration> </DataCollector> </DataCollectors> </DataCollectionRunSettings> <InProcDataCollectionRunSettings> <InProcDataCollectors> <InProcDataCollector assemblyQualifiedName="Coverlet.Collector.DataCollection.CoverletInProcDataCollector, coverlet.collector, Version=2.7.0.0, Culture=neutral, PublicKeyToken=null" friendlyName="XPlat Code Coverage" enabled="True" codebase="coverlet.collector.dll" /> </InProcDataCollectors> </InProcDataCollectionRunSettings> </RunSettings>
I hope you can help me?
Issue Analytics
- State:
- Created 4 years ago
- Comments:5
Top GitHub Comments
OK I spotted your samples for settings file and I have this working now! Thanks!
Coverlet is used through 3 different drivers, msbuild, .net tools and vstest integration…
XPlat Code Coverage
is the way to indicate that you want to load coverlet collectors…msbuild work only withdotnet test /p:CollectCoverage=true
check the guide https://github.com/tonerdo/coverlet#quick-start