{{ message }}
feat(deps): add pytest-xdist for parallel test execution#216
Open
ayeshakhalid192007-dev wants to merge 1 commit into
Open
feat(deps): add pytest-xdist for parallel test execution#216ayeshakhalid192007-dev wants to merge 1 commit into
ayeshakhalid192007-dev wants to merge 1 commit into
Conversation
Adds pytest-xdist==3.8.0 to project dependencies and configures CI to run tests with -n 2 workers, enabling parallel test execution. Closes nirtal85#1
There was a problem hiding this comment.
🧹 Nitpick comments (1)
.github/workflows/devRun.yml (1)
44-44: Make xdist worker count configurable instead of hardcoding2.Line 44 works, but parameterizing workers makes CI tuning easier without editing workflow code.
Proposed refactor
env: FLAKINESS_PROJECT: nirtal85/Playwright-Python-Example + PYTEST_XDIST_WORKERS: "2" @@ - - name: Test with pytest - run: xvfb-run .venv/bin/python -m pytest -m devRun -n 2 --base-url ${{ vars.BASE_URL }} + - name: Test with pytest + run: xvfb-run .venv/bin/python -m pytest -m devRun -n "${PYTEST_XDIST_WORKERS}" --base-url ${{ vars.BASE_URL }}🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.github/workflows/devRun.yml at line 44, Replace the hardcoded xdist worker count "-n 2" with a configurable workflow variable: define a job- or workflow-level env like TEST_WORKERS defaulting to "2" and update the pytest command (the line containing "xvfb-run .venv/bin/python -m pytest -m devRun -n 2 --base-url ${{ vars.BASE_URL }}") to use "-n ${{ env.TEST_WORKERS }}" (or use ${{ vars.TEST_WORKERS }} if you prefer repo-level vars) so CI tuning can change worker count without editing the workflow file.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In @.github/workflows/devRun.yml:
- Line 44: Replace the hardcoded xdist worker count "-n 2" with a configurable
workflow variable: define a job- or workflow-level env like TEST_WORKERS
defaulting to "2" and update the pytest command (the line containing "xvfb-run
.venv/bin/python -m pytest -m devRun -n 2 --base-url ${{ vars.BASE_URL }}") to
use "-n ${{ env.TEST_WORKERS }}" (or use ${{ vars.TEST_WORKERS }} if you prefer
repo-level vars) so CI tuning can change worker count without editing the
workflow file.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 10b687ec-f2e1-4427-bc21-28d542946c52
⛔ Files ignored due to path filters (1)
uv.lockis excluded by!**/*.lock
📒 Files selected for processing (2)
.github/workflows/devRun.ymlpyproject.toml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

What does this PR do?
Adds
pytest-xdistsupport to enable parallel test execution across multiple worker processes, as requested in #1.Root Cause
Tests were running sequentially in CI, causing slow feedback loops. There was no parallelisation mechanism in place despite
pytest-playwrighthaving built-in support forpytest-xdistworkers.Changes
pyproject.toml: Addedpytest-xdist==3.8.0to project dependencies.github/workflows/devRun.yml: Added-n 2flag to the pytest CI commandpyproject.toml: Addedasyncio_mode = "auto"under[tool.pytest.ini_options]to ensure async compatibility with xdist workersExpected Impact
pytest-playwright's built-in xdist support — no changes to fixtures or test files requiredType of Change
Checklist
pytest -n 2)-n 2flagCloses #1