Testing¶
Running Tests¶
Quick run (no verbose):
Automated Test Structure¶
Tests live in tests/ at the repo root:
| File | Coverage |
|---|---|
test_onboarding.py |
Product create/delete, scaffold validation, units |
test_case_prep.py |
Case prep (case.yaml staging) |
test_bindings.py |
Solver bindings resolution |
test_cli_parsing.py |
Argparse flag parsing |
test_shim_errors.py |
MCP client error paths |
test_mcp_transport.py |
MCP URL resolution, tool result parsing |
test_workflow.py |
Workflow generation and execution |
test_gates.py |
Gate evaluation logic |
test_gates_routing.py |
Requirement-to-domain routing |
test_gates_edge_cases.py |
Edge cases (zero gates, missing data) |
test_requirements.py |
Requirement loading, status, mapping |
test_solver_dispatch.py |
Solver dispatch and surrogate routing |
test_kpi_spec.py |
KPI spec loading, reducers, compute |
test_spec_gates.py |
Spec-driven gate evaluation |
test_product_gates.py |
Product-level gate integration |
test_contracts.py |
Assessment contract validation |
test_releases.py |
Release freeze/list |
Running Specific Tests¶
# Single file
python -m pytest tests/test_onboarding.py -v
# Single test
python -m pytest tests/test_onboarding.py::TestCreateProgramme::test_units_in_custom_data -v
# With coverage
python -m pytest tests/ --cov=arxyne_platform --cov-report=term-missing
Writing Tests¶
- Use
conftest.pyfixtures for product loading and USD stage setup - Mock MCP calls — don't require running solver servers for unit tests
- Test gate logic against known inputs/outputs
- Assert on gate status vocabulary (
PASS,FAIL,INCONCLUSIVE) - No hardcoded product-specific values in assertions — use target-relative checks