Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions .github/workflows/test.yml
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
Comment on lines +19 to +35
Copy link

Copilot AI Feb 22, 2026

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.

Suggested change
# 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
# Set up Python and uv; uv will manage dependencies via the lockfile
- name: Set up Python with uv
uses: astral-sh/setup-uv@v4
with:
python-version: '3.13'
# Install the package and dependencies using uv and the uv.lock file
# Using --all-extras keeps behavior consistent with installing extras via pip
- name: Install dependencies
run: uv sync --all-extras
# PERFORMANCE: -n auto enables parallel execution via pytest-xdist,
# distributing tests across available CPU cores for 40%+ faster runs
- name: Run tests
run: uv run pytest tests/ -n auto

Copilot uses AI. Check for mistakes.
6 changes: 6 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Copy link

Copilot AI Feb 22, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For consistency and to ensure all pytest invocations benefit from parallel execution (not just CI runs), consider adding "-n auto" to the addopts configuration. This ensures developers running pytest locally and other workflows also get parallel execution by default. Suggested: addopts = "-n auto -v --strict-markers". This aligns with the performance optimization goal mentioned in the PR description and follows the pattern where configuration is centralized in pyproject.toml.

Suggested change
addopts = "-v --strict-markers"
addopts = "-n auto -v --strict-markers"

Copilot uses AI. Check for mistakes.
Loading