-
Notifications
You must be signed in to change notification settings - Fork 388
coverlet is 'blind' to code coverage data in certain XUnit test projects #1311
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@jasells, a first comment on the repro is that you shouldn't typically use both I suspect starting the NetMQ thread may interfere with this, so that the process exit event doesn't trigger. The method your repro calls starts a foreground thread, so you can try instead starting NetMQ as a background thread so that it doesn't interfere with process exit: You can also try switching to using |
No luck there. Same issue. However, re:
Yes! Starting that thread as background did result in coverlet gathering coverage data! TY! I did have to update the NetMQ package to the latest, as the older version i used in repro did not make the I have been picking at this for 2+ yrs, finally got the time to track it down to the source. This was my first time using XUnit and coverlet, so I thought I was doing something wrong, but as I used XUnit and coverlet on >12 other repos, and never had an issue, i slowly built evidence I needed that it was related somehow to NetMQ. In my defense, even if I knew about the prcess exit event, NetMQ says that it starts a background thread in the API to start it, even though looking @ source it doesn't. |
Great that it was solved, @jasells! |
Is there anything to get a little more insight into this? And what does MS's tool do differently than coverlet that allows it to not be subject to the same issue? They both seem to be using vstest... |
https://github.com/coverlet-coverage/coverlet/blob/master/Documentation/KnownIssues.md discusses it a bit more, and links to a vstest issue with further information. I don't know what the MS coverage collector might be doing differently, but given what you described I would hazard a guess that it collects coverage stats continuously as the tests run, rather than transferring them at the end. We made an attempt at solving that using shared memory, but (somewhat ironically) that implementation made coverlet unusable for the .NET runtime coverage testing. There's a discussion initiated here about having another go at it: #1251 |
Similar to #578
MS's coverage collector in VS enterprise/test sees the coverage just fine, but coverlet is "blind" to all coverage that should be available from a particular XUnit test project. It seems to be linked to a particular call to a dependency lib that starts a thread.
If anyone else is experiencing this, this link will help to use MS's collector in your pipeline to collect coverage data (without VS Enterprise). This is my plan B.
https://medium.com/swlh/generating-code-coverage-reports-in-dotnet-core-bb0c8cca66.
I can verify that MS's coverage collector works.
i have a repro here. The issue revolves around a .NetStnd library project referencing a 3rd party package/lib: NetMQ. But, the symptoms are the same as issue #578 , so possibly a similar underlying issue?
See the readme in the repro for more details, the highlights are:
Note: I have run this on WIndows 10 both manually (VS) and in a devOps pipeline, same results.
The text was updated successfully, but these errors were encountered: