question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Runsettings file failing with error "Data collection : Could not find data collector 'XPlat Code Coverage"

See original GitHub issue

Hi, 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:closed
  • Created 4 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
dougiejaycommented, Nov 16, 2019

OK I spotted your samples for settings file and I have this working now! Thanks!

0reactions
MarcoRossignolicommented, Nov 16, 2019

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 with dotnet test /p:CollectCoverage=true check the guide https://github.com/tonerdo/coverlet#quick-start

Read more comments on GitHub >

github_iconTop Results From Across the Web

What is causing "Could not find data collector 'XPlat Code ...
I was trying to get the code coverage working in my azure devops pipeline and this did the trick for me. I was...
Read more >
Configure unit tests by using a .runsettings file
A common use of a .runsettings file is to customize code coverage analysis. Runsettings files can be used to configure tests that are...
Read more >
coverlet
Coverlet is a cross platform code coverage framework for .NET, with support for line, branch and method coverage. It works with .NET Framework...
Read more >
NET Core coverage with coverlet - hectormartinez.dev
NET Core project template comes with coverlet which is the framework that will retrieve the code coverage. So we do not need to...
Read more >
mirrors_DataDog/coverlet
Coverlet collects and writes hits data on process exit, if for some reason the process is too slow to close, it will be...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found