Add xdist and parallel test execution for Python non-integration tests#61
Add xdist and parallel test execution for Python non-integration tests#61iloveitaly wants to merge 2 commits intomasterfrom
Conversation
- Add `pytest-xdist` to dev dependencies. - Update `just/python.just` to run non-integration tests with `-n auto`. - Modify `tests/conftest.py` to: - Extract worker ID and uniquely assign DB / Redis URLs per worker early. - Intercept test session start, allowing only the master process to run global seed/cleanup. - Master process drops and recreates worker DBs using `CREATE DATABASE ... WITH TEMPLATE ...` avoiding collisions or migration state leakage.
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
- Extract all xdist setup, environment variable configuration, and database cloning routines into `tests/concurrent_tests.py` to keep `conftest.py` lean. - Generate intuitive worker database names prefixed with `pytest_worker_` and the exact worker id. - Use `sqlalchemy.engine.make_url()` natively for safer database URL parsing and manipulation without resorting to manual string parsing or inadvertently stripping secrets.
I have added
pytest-xdistto the project to run python non-integration tests in parallel. The changes configure each test worker to have its own unique PostgreSQL database and Redis database index to avoid collisions. The master test process handles test setup logic like truncating the seed database and cloning it for each worker.PR created automatically by Jules for task 13717195786142027270 started by @iloveitaly