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

Parallelize the test suite #16178

Closed
woodruffw opened this issue Jun 27, 2024 · 1 comment · Fixed by #16206
Closed

Parallelize the test suite #16178

woodruffw opened this issue Jun 27, 2024 · 1 comment · Fixed by #16206
Labels
developer experience Anything that improves the experience for Warehouse devs testing Test infrastructure and individual tests

Comments

@woodruffw
Copy link
Member

From conversation wit @miketheman: the tests do currently parallelize cleanly, but coverage is broken in the process. My SWAG explanation is that coverage's intermediate files may be generated with the same seed in each process, resulting in clobbered outputs.

WIP branch from above: https://github.com/pypi/warehouse/compare/main...miketheman:miketheman/pytest-xdist?expand=1

I've asked @DarkaMaul to take a look at this once his queue is empty 🙂

@woodruffw woodruffw added testing Test infrastructure and individual tests developer experience Anything that improves the experience for Warehouse devs labels Jun 27, 2024
@DarkaMaul
Copy link
Contributor

DarkaMaul commented Jul 1, 2024

Hi all - I've spent some time analyzing this issue.

I managed to find a solution to improve the coverage report using sitecustomize.py.

The idea is borrowed from coverage documentation and is also used by pytest-cov plugin : here

My work-in-progress is available here

I get about 99% coverage, with the following report
A progress, but still not complete.

Edit: I overlooked the regex used in the .coveragerc file and now the coverage is complete:

+ python -m coverage report -m --fail-under 100
Name    Stmts   Miss Branch BrPart  Cover   Missing
---------------------------------------------------
TOTAL   14394      0   4572      0   100%

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
developer experience Anything that improves the experience for Warehouse devs testing Test infrastructure and individual tests
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants