Parallel testing for faster local testing#360
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #360 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 12 12
Lines 1701 1701
Branches 213 213
=========================================
Hits 1701 1701
Flags with carried forward coverage won't be shown. Click here to find out more. Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This PR adds opt-in parallel execution support for the Cachier pytest suite (via pytest-xdist) and updates local tooling/docs to make faster, safer local test runs possible across multiple backends.
Changes:
- Add parallel-test dependencies (
pytest-xdist,pytest-rerunfailures,pytest-asyncio) to test requirements. - Introduce new shared pytest fixtures for worker isolation (SQL schema and cache directory).
- Enhance
scripts/test-local.shwith--parallel/--workerssupport and updatepyproject.tomlpytest/coverage configuration.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/requirements.txt | Adds plugins needed for parallel execution and flaky retries. |
| tests/conftest.py | New autouse fixtures to isolate SQL schemas and cache dirs across xdist workers. |
| tests/README.md | Adds comprehensive testing/parallelization documentation. |
| scripts/test-local.sh | Adds CLI flags and logic to run pytest with xdist and manage serial-vs-parallel runs. |
| pyproject.toml | Adds Black config, new pytest markers, and enables coverage parallel mode. |
This pull request introduces parallel test execution support to the testing infrastructure, improving test speed and reliability. It adds new pytest fixtures and configuration to enable safe parallelization, including worker-specific isolation for SQL and cache-based tests. The test runner script (
test-local.sh) is enhanced with options for parallel execution, and the test dependencies are updated accordingly.Key changes include:
Parallel Test Execution Support:
pytest-xdistand related plugins totests/requirements.txtto enable parallel test execution and automatic retries for flaky tests.-p/--parallel,-w/--workers) inscripts/test-local.shto run tests in parallel and specify the number of workers. The script now installspytest-xdistif needed and handles serial vs. parallel test execution, including special handling for pickle and memory tests. [1] [2] [3] [4] [5] [6] [7] [8] [9]Test Isolation and Fixtures:
tests/conftest.pywith fixtures for:Configuration Updates:
pyproject.toml:tool.blackconfiguration for consistent formatting.These changes collectively make the test suite faster, more robust, and ready for parallel execution, especially important for large or slow-running test suites.