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
27 changes: 27 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Test

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
test:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v4

- name: Set up uv
uses: astral-sh/setup-uv@v4

- name: Set up Python
run: uv python install 3.13

- name: Install dependencies
run: uv sync --all-extras

- name: Run tests
run: uv run pytest tests/ -n auto -v
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 -n auto flag is redundant here since it's already configured as the default in pyproject.toml via addopts = "-n auto". Consider removing -n auto from this command to avoid duplication and rely on the centralized configuration. This makes the pytest configuration easier to maintain in one place.

Suggested change
run: uv run pytest tests/ -n auto -v
run: uv run pytest tests/ -v

Copilot uses AI. Check for mistakes.
32 changes: 16 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,41 +126,41 @@ This project includes a comprehensive test suite to ensure code quality and corr

### Running Tests

**Basic test execution:**
**Basic test execution (parallel by default):**
```bash
# Install dev dependencies first
pip install pytest pytest-mock pytest-xdist
uv sync --all-extras

# Run all tests
pytest tests/
# Run all tests (uses -n auto by default via pyproject.toml)
uv run pytest tests/
```

**Parallel test execution (recommended):**
**Parallel test execution:**
```bash
# Run tests in parallel using all available CPU cores
pytest tests/ -n auto
# Run tests in parallel using all available CPU cores (default via addopts)
uv run pytest tests/ -n auto
Comment on lines +138 to +141
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 comment states "uses -n auto by default via pyproject.toml" which is accurate, but then the example command explicitly includes -n auto again. This is redundant since running uv run pytest tests/ (without -n auto) will already use parallel execution due to the addopts configuration. Consider updating the comment to clarify that the flag is optional/redundant here, or remove the -n auto from the example to demonstrate relying on the default configuration.

Copilot uses AI. Check for mistakes.

# Run with specific number of workers
pytest tests/ -n 4
uv run pytest tests/ -n 4
```

**Note on parallel execution:** The test suite is currently small (~78 tests, <1s execution time), so parallel execution overhead may result in longer wall-clock time compared to sequential execution. However, pytest-xdist is included for:
**Note on parallel execution:** Parallel execution is configured as the default via `addopts = "-n auto"` in `pyproject.toml`. pytest-xdist provides:
- **Test isolation verification** - Ensures tests don't share state
- **Future scalability** - As the test suite grows, parallel execution will provide significant speedups
- **CI optimization** - May benefit from parallelization in CI environments with different characteristics
- **Faster CI runs** - Parallel execution reduces test suite time, especially as the suite grows
- **Scalability** - As the test suite grows, parallelization provides increasing speedups

### Development Workflow

For active development with frequent test runs:
```bash
# Run tests sequentially (faster for small test suites)
pytest tests/ -v
# Run tests in parallel (default)
uv run pytest tests/ -v

# Run specific test file
pytest tests/test_security.py -v
uv run pytest tests/test_security.py -v

# Run tests matching pattern
pytest tests/ -k "test_validation" -v
uv run pytest tests/ -k "test_validation" -v
```

## Release Process
Expand All @@ -170,7 +170,7 @@ This project uses manual releases via GitHub Releases. To create a new release:
1. **Ensure all changes are tested and merged to `main`**
```bash
# Verify tests pass
pytest tests/
uv run pytest tests/

# Verify security scans pass
bandit -r main.py -ll
Expand Down
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,6 @@ dev = [
"pytest-xdist>=3.0.0",
"pytest-benchmark>=4.0.0",
]

[tool.pytest.ini_options]
addopts = "-n auto"
Loading