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.

/p:CollectCoverage=true causes all test discovery to fail when class derives from XUnitVerifier

See original GitHub issue

Repro Unzip: mytestlib.zip Within the unzipped directory, run:

dotnet test
dotnet test /p:CollectCoverage=true

Notice how the one test method runs successfully the first time. But when code coverage is enabled, no tests are discovered at all.

I suspect an exception is being thrown during the code coverage instrumentation. Perhaps the XunitVerifier class I’m using as a base class (which is required to repro the failure) uses a pattern that coverlet.msbuild can’t deal with.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
MarcoRossignolicommented, Sep 16, 2019

I moved from warning to verbose because xunit will warning every time. https://github.com/tonerdo/coverlet/pull/548

0reactions
MarcoRossignolicommented, Sep 17, 2019

Maybe the message is not so clear…I mean “embedded pdb without local source files,” local is about local hard drive…if sources are not on pc running test we skip.

Read more comments on GitHub >

github_iconTop Results From Across the Web

/p:CollectCoverage=true causes all test discovery to fail ...
I suspect an exception is being thrown during the code coverage instrumentation. Perhaps the XunitVerifier class I'm using as a base class ( ......
Read more >
Xunit Unit Tests will not run
To fix, as mentioned here, from the Visual Studio menu, go to Test -> Test Settings -> Default Processor Architecture and set that...
Read more >
How To Resolve Issue Of Test Project Not Running The ...
Introduction. I was upgrading the .NET Core 3.1 project to .NET 6 and faced issues running test cases in my test projects.
Read more >
Using xUnit to Test your C# Code
This type of test focuses on testing a unit of code: a building block of a software application, such as a function or...
Read more >
Problems with .NET unit testing
The following information is essential to determine the cause of the issue: ... We are unable to run tests without rebuilding all dependencies...
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