-
Notifications
You must be signed in to change notification settings - Fork 1
Enable parallel pytest execution with pytest-xdist by default #406
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,28 @@ | ||||||
| name: Tests | ||||||
|
|
||||||
| on: | ||||||
| push: | ||||||
| branches: [main] | ||||||
| pull_request: | ||||||
| branches: [main] | ||||||
|
|
||||||
| jobs: | ||||||
| test: | ||||||
| permissions: | ||||||
| contents: read | ||||||
| runs-on: ubuntu-latest | ||||||
|
|
||||||
| steps: | ||||||
| - name: Checkout repo | ||||||
| uses: actions/checkout@v4 | ||||||
|
|
||||||
| - name: Set up Python | ||||||
| uses: actions/setup-python@v5 | ||||||
| with: | ||||||
| python-version: '3.13' | ||||||
|
|
||||||
| - name: Install dependencies | ||||||
| run: pip install httpx python-dotenv pytest pytest-mock pytest-xdist | ||||||
|
|
||||||
| - name: Run tests in parallel | ||||||
| run: pytest tests/ -n auto -v | ||||||
|
||||||
| run: pytest tests/ -n auto -v | |
| run: pytest tests/ -v |
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -126,41 +126,35 @@ This project includes a comprehensive test suite to ensure code quality and corr | |||||||||
|
|
||||||||||
| ### Running Tests | ||||||||||
|
|
||||||||||
| **Basic test execution:** | ||||||||||
| **Basic test execution (runs in parallel by default):** | ||||||||||
| ```bash | ||||||||||
| # Install dev dependencies first | ||||||||||
| pip install pytest pytest-mock pytest-xdist | ||||||||||
|
Comment on lines
131
to
132
|
||||||||||
| # Install dev dependencies first | |
| pip install pytest pytest-mock pytest-xdist | |
| # Install dev dependencies first (uses uv for consistency with CI/tooling) | |
| uv sync --all-extras |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -16,3 +16,6 @@ dev = [ | |
| "pytest-xdist>=3.0.0", | ||
| "pytest-benchmark>=4.0.0", | ||
| ] | ||
|
|
||
| [tool.pytest.ini_options] | ||
| addopts = "-n auto" | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The dependency installation approach is inconsistent with other workflows in this repository. The sync.yml workflow uses pip with caching enabled (via setup-python's cache parameter), while performance.yml uses the modern uv package manager with built-in caching. This test.yml workflow uses pip without any caching, which will result in slower CI runs.
Recommend aligning with the performance.yml pattern by using uv:
This approach provides better caching, faster dependency resolution, and consistency with the modern tooling already established in performance.yml.