Skip to content
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

Support for pytest-xdist, multiprocessing, etc. #9

Open
jaltmayerpizzorno opened this issue May 3, 2022 · 4 comments
Open

Support for pytest-xdist, multiprocessing, etc. #9

jaltmayerpizzorno opened this issue May 3, 2022 · 4 comments
Assignees
Labels
enhancement New feature or request

Comments

@jaltmayerpizzorno
Copy link
Collaborator

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.

@anilbey
Copy link

anilbey commented May 24, 2023

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

@cameronbrill
Copy link

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

@jaltmayerpizzorno
Copy link
Collaborator Author

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)!

@jaltmayerpizzorno
Copy link
Collaborator Author

jaltmayerpizzorno commented Apr 3, 2024

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... :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants