-
Notifications
You must be signed in to change notification settings - Fork 1
Add dedicated test workflow with parallel pytest execution #405
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,35 @@ | ||
| name: Tests | ||
|
|
||
| on: | ||
| push: | ||
| branches: [main] | ||
| pull_request: | ||
| workflow_dispatch: | ||
|
|
||
| jobs: | ||
| test: | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: read | ||
|
|
||
| steps: | ||
| - name: Checkout repo | ||
| uses: actions/checkout@v4 | ||
|
|
||
| # PERFORMANCE: Cache pip dependencies to speed up CI runs | ||
| # Cache key is based on pyproject.toml hash since dev deps are defined there | ||
| - name: Set up Python | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: '3.13' | ||
| cache: 'pip' | ||
| cache-dependency-path: 'pyproject.toml' | ||
|
|
||
| # Install the package with dev dependencies (pytest, pytest-mock, pytest-xdist) | ||
| - name: Install dependencies | ||
| run: pip install -e ".[dev]" | ||
|
|
||
| # PERFORMANCE: -n auto enables parallel execution via pytest-xdist, | ||
| # distributing tests across available CPU cores for 40%+ faster runs | ||
| - name: Run tests | ||
| run: pytest tests/ -n auto | ||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -16,3 +16,9 @@ dev = [ | |||||
| "pytest-xdist>=3.0.0", | ||||||
| "pytest-benchmark>=4.0.0", | ||||||
| ] | ||||||
|
|
||||||
| [tool.pytest.ini_options] | ||||||
| testpaths = ["tests"] | ||||||
| python_files = "test_*.py" | ||||||
| python_functions = "test_*" | ||||||
| addopts = "-v --strict-markers" | ||||||
|
||||||
| addopts = "-v --strict-markers" | |
| addopts = "-n auto -v --strict-markers" |
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 workflow uses pip for dependency installation, but the repository has a uv.lock file and the performance.yml workflow uses uv (astral-sh/setup-uv@v4 + uv sync --all-extras). For consistency with the existing performance workflow and to ensure deterministic builds using the lockfile, this workflow should also use uv. Replace the setup-python caching and pip install steps with uv installation and sync, similar to performance.yml lines 19-30.