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 pytest with pytest-xdist #1283

Merged
merged 2 commits into from
Mar 5, 2025
Merged

parallelize pytest with pytest-xdist #1283

merged 2 commits into from
Mar 5, 2025

Conversation

gboeing
Copy link
Owner

@gboeing gboeing commented Mar 5, 2025

This PR parallelizes pytest in the CI tests and bash script with the pytest-xdist package, to run the tests simultaneously across 3 parallel processes. It runs the two longest-runtime tests (test_features() and test_graph_from()) each in their own processes, and groups all the other tests into a third process.

In total, this reduces the tests execution time by over 50%.

Github actions runners offer 4 CPUs, but we should probably limit it to 3 processes to avoid rate-limiting from the Overpass API if we're hitting it from multiple processes simultaneously.

Copy link

codecov bot commented Mar 5, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.44%. Comparing base (844dd79) to head (325ccde).
Report is 3 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1283   +/-   ##
=======================================
  Coverage   98.44%   98.44%           
=======================================
  Files          24       24           
  Lines        2383     2383           
=======================================
  Hits         2346     2346           
  Misses         37       37           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@gboeing gboeing merged commit d998569 into main Mar 5, 2025
10 checks passed
@gboeing gboeing deleted the tests branch March 5, 2025 23:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant