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:
2026-05-13 21:26:18 +00:00
parent 56662fef43
commit cb0fccb270
3 changed files with 24 additions and 6 deletions
+2 -2
View File
@@ -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()