Skip to content

feat(e2e): parallelize e2e tests with pytest-xdist (default -n 5)#102

Merged
johntmyers merged 3 commits intomainfrom
feat/101-parallelize-e2e/johntmyers
Mar 5, 2026
Merged

feat(e2e): parallelize e2e tests with pytest-xdist (default -n 5)#102
johntmyers merged 3 commits intomainfrom
feat/101-parallelize-e2e/johntmyers

Conversation

@johntmyers
Copy link
Copy Markdown
Collaborator

@johntmyers johntmyers commented Mar 4, 2026

🏗️ build-from-issue-agent

Closes #101

Summary

Add pytest-xdist for parallel e2e test execution with a configurable concurrency factor. Defaults to 5 concurrent workers; override via E2E_PARALLEL env var (accepts a number or "auto" for CPU-count matching).

Changes Made

  • pyproject.toml: Added pytest-xdist>=3.0 to dev dependencies
  • e2e/python/conftest.py: Added _worker_suffix session fixture using xdist's worker_id; updated mock route fixtures to use worker-unique names and routing hints; changed fixtures to yield routing_hint instead of name
  • e2e/python/test_inference_routing.py: Updated 4 tests to use fixture-provided routing hints instead of hard-coded strings
  • build/test.toml: Updated test:e2e:sandbox task to pass -n ${E2E_PARALLEL:-5} for parallel execution

Deviations from Plan

None — implemented as planned.

Usage

# Default: 5 concurrent workers
mise run test:e2e:sandbox

# CPU-count matching
E2E_PARALLEL=auto mise run test:e2e:sandbox

# Explicit count
E2E_PARALLEL=10 mise run test:e2e:sandbox

# Sequential (restore old behavior)
E2E_PARALLEL=1 mise run test:e2e:sandbox

Tests Added

  • Unit: N/A — test infrastructure change
  • Integration: N/A
  • E2E: Existing e2e tests are the validation; this change makes them run in parallel without races

Verification

  • Pre-commit checks passing (unit tests, lint, format — only pre-existing tmp/network_checks.py license header failure)
  • E2E tests (requires live cluster — no e2e/ source files added, only fixture/config changes)

Closes #101

Add pytest-xdist for parallel e2e test execution with configurable
concurrency. Default to 5 workers; override via E2E_PARALLEL env var
(accepts a number or 'auto' for CPU-count matching). Make session-scoped
mock inference route fixtures worker-safe by incorporating the xdist
worker_id into route names and routing hints.
@johntmyers johntmyers self-assigned this Mar 4, 2026
@johntmyers johntmyers requested review from drew and pimlock and removed request for drew March 4, 2026 21:14
@johntmyers johntmyers added the test:e2e Requires end-to-end coverage label Mar 4, 2026
@johntmyers johntmyers merged commit cdc2ee5 into main Mar 5, 2026
10 checks passed
@johntmyers johntmyers deleted the feat/101-parallelize-e2e/johntmyers branch March 5, 2026 16:04
drew pushed a commit that referenced this pull request Mar 16, 2026
Closes #101

Add pytest-xdist for parallel e2e test execution with configurable
concurrency. Default to 5 workers; override via E2E_PARALLEL env var
(accepts a number or 'auto' for CPU-count matching). Make session-scoped
mock inference route fixtures worker-safe by incorporating the xdist
worker_id into route names and routing hints.

Co-authored-by: John Myers <johntmyers@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

test:e2e Requires end-to-end coverage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: parallelize e2e tests with configurable concurrency (pytest-xdist)

1 participant