2.6 KiB
2.6 KiB
icon
| icon |
|---|
| lucide/flask-conical |
Testing
This page describes the current test layout and execution model for this repository.
Primary guidance sources:
Goals
- Keep local feedback fast with deterministic tests.
- Mirror source modules with focused test groups.
- Keep endpoint and MCP surface checks explicit.
- Make marker usage strict and intentional.
Current Test Layout
Current tree:
tests/
__init__.py
conftest.py
registry/
ingest/
conftest.py
test_current_docs.py
test_document.py
test_prompt.py
test_skill.py
models/
test_document_validation.py
test_prompt_validation.py
test_registry_payload_models.py
test_skill_validation.py
web/
conftest.py
test_endpoint_connections.py
test_mcp_skills.py
Source-to-test alignment today:
src/personal_mcp/registry/ingest/->tests/registry/ingest/src/personal_mcp/registry/models/->tests/registry/models/src/personal_mcp/web/and MCP HTTP surface ->tests/web/
Markers And Strictness
Configured markers in pyproject.toml:
unit: fast deterministic tests with no external dependenciesintegration: framework or component integration testssmoke: thin critical-path checks
Pytest runs with --strict-markers, so any unregistered marker fails the test run.
Fixture Layering
Fixture placement follows test scope:
tests/conftest.pyfor cross-suite defaults.tests/registry/ingest/conftest.pyfor ingest-specific setup.tests/web/conftest.pyfor web and endpoint client setup.
Prefer adding fixtures at the narrowest scope that serves more than one test.
Command Baseline
Canonical invocation:
uv run pytest
Useful filtered runs:
uv run pytest --collect-only -q
uv run pytest -m unit -q
uv run pytest -m integration -q
uv run pytest -m smoke -q
Adding New Tests
When adding coverage:
- Place tests under the nearest existing module subtree (
registry/orweb/). - Mirror the source path where practical.
- Reuse existing
conftest.pyfiles before adding new fixture layers. - Add markers only when they convey execution intent, and register new markers in
pyproject.tomlfirst.
This keeps the suite aligned with the current architecture while preserving a fast local test loop.