plasma-umass / slipcover

Near Zero-Overhead Python Code Coverage

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support for pytest-xdist, multiprocessing, etc.

jaltmayerpizzorno opened this issue · comments

Slipcover doesn't currently have a way to merge/coordinate coverage data collected on multiple processes into a single output.
Attempts to use pytest-xdist yield partial coverage results.

Hello, it would be great to see pytest-forked supported as well.

Hi @jaltmayerpizzorno, have you done any work here? If not, I may try to tackle this so would appreciate any tips/pointers!

Hi @cameronbrill, no, sorry, I haven't put work towards this yet. I imagine that it would be implemented by having each process collect coverage separately and write to a file and then merge together. So far I think writing to JSON, and merging JSON results, would make a lot of sense. I can try to contribute some refactorings towards this. But in general I'd read pytest-xdist (or -forked) code to see how it works and what it requires. I'd be happy to support your efforts by answering questions (as time allows)!

I just added (in v1.0.4) support for pytest-forked. I haven't tried yet with pytest-xdist, but anything that uses os.fork() and then os._exit() is likely to work. If anyone wants to give it a try and let me know... :)