Testing and quality
Tests exercise retained behavior through the public application API and real dependency integrations. Framework unit tests cover repository tooling and public exports. Integration tests use the configured resolver, FastAPI, and Starlette directly.
Run checks¶
uv sync --locked --all-groups
make check
make ci
make check runs linting, formatting checks, strict Pyright, syntax and
documentation checks, import boundaries, repository policy, unit and
integration tests, and coverage. make ci adds dependency and license audits,
secret scanning, package validation, documentation browser tests, container
verification, and pre-commit checks.
Coverage thresholds¶
- Statement coverage: at least 95%.
- Branch coverage: at least 90%.
- Changed-source coverage: at least 95%.
These thresholds apply to src/titancore. A test should prove behavior the
application can use. Do not retain feature tests for removed modules or add
tests that exist only to increase coverage.
Integration tests¶
Integration tests exercise the actual application boundary. They verify
configuration and provider injection through a FastAPI request, then check
container cleanup at ASGI shutdown. PostgreSQL integration tests apply an
Alembic migration to pgvector, exercise async Psycopg queries and transactions,
and resolve a request-scoped database session through FastAPI and the
application container. Local tests first look for the titancore_test
database on the standard Unix PostgreSQL sockets, so make test works without
an environment variable when a local server is available. Set
TITANCORE_TEST_DATABASE_URL to override discovery; CI provides the explicit
URL for its PostgreSQL service with pgvector enabled.
The skeleton repository tests the complete application use case, including its welcome and health endpoints, configuration, dependency injection, and installation against a pinned framework revision.