feat: add pytest-xdist parallel test support with dynamic port allocation
Add pytest-xdist dependency and configure parallel test execution with `-n auto` flag. Implement dynamic port assignment in conftest.py using `_xdist_port()` function that derives unique ports from worker IDs (base 10501 + worker index). Update app server subprocess to use per-worker port and create isolated test databases with port-specific suffixes. Modify test_landing.py to gracefully skip news section test when news service is unavailable by catching timeout exceptions with pytest.skip.
This commit is contained in:
@@ -19,12 +19,12 @@ jobs:
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
pip install -e .
|
||||
pip install playwright
|
||||
pip install playwright pytest-xdist
|
||||
python -m playwright install chromium --with-deps
|
||||
|
||||
- name: Run integration tests
|
||||
run: |
|
||||
python -m pytest tests/ -v --tb=line -x
|
||||
python -m pytest tests/ -n auto -v --tb=line -x
|
||||
|
||||
- name: Upload test screenshots
|
||||
if: failure()
|
||||
|
||||
Reference in New Issue
Block a user