This document describes how to run the test suite for the application.
Ensure you have the development dependencies installed. You can install them along with the package in editable mode using uv:
uv pip install -e '.[dev]'To run all tests, including linting with Ruff, code coverage with pytest-cov, and the pytest suite itself, you can use the provided Makefile:
make lint-testThis command will:
- Check code formatting and linting with Ruff
- Run the pytest suite with coverage reporting
The project uses Ruff for both linting and formatting:
To check your code for issues without modifying files:
make lintThis runs Ruff's check command on the codebase.
To automatically format your code:
make formatThis runs Ruff's format command and then applies any auto-fixes from the linter.
To check if code is properly formatted without modifying files (useful for CI):
make lint-checkYou can run the test suite using:
make testThis runs pytest (optionally in parallel) with a wall-clock timeout so the suite can’t hang forever.
- Default timeout: 180 seconds (3 minutes) for the entire run
- Override:
WALLCLOCK_TIMEOUT_SECONDS=0 make test(disable timeout; debug only)WALLCLOCK_TIMEOUT_SECONDS=900 make test(15 minutes)
Run targeted tests from backend/ with Python's pytest module, or from the
repository root with the Makefile for standard full-suite behavior.
cd backend
python -m pytest tests/api/v1/test_search_endpoints.py
python -m pytest tests/services/ -k search
python -m pytest -m <marker_name>If Docker services are required for the test you are running, start them first:
docker compose up -d paradedb elasticsearch redismake test runs pytest with coverage and enforces COVERAGE_THRESHOLD
(default 50). make test-no-coverage and make test-fast skip coverage for
debugging speed. HTML coverage output is written under backend/htmlcov/ when
coverage is enabled.
- Re-run the full backend suite with
make test. - Review slow or flaky tests and update timeout/concurrency guidance if needed.
- Confirm Docker test database setup still matches the Makefile.
- Add regression tests for any production incidents or runbook changes from the quarter.
- Keep this file and ../make_tasks.md aligned with new test targets or environment variables.