|
| 1 | +# Unit Test Traceability Matrix |
| 2 | + |
| 3 | +**Feature**: ADF Configuration Validation |
| 4 | +**Phase 2 Doc**: `.docs/design-adf-validation.md` |
| 5 | +**Phase 2.5 Doc**: `.docs/design-adf-validation.md` (Specification Interview Findings) |
| 6 | + |
| 7 | +## Coverage Summary |
| 8 | + |
| 9 | +| Metric | Target | Actual | Status | |
| 10 | +|--------|--------|--------|--------| |
| 11 | +| Functions validated | 1 (validate) | 1 | PASS | |
| 12 | +| Edge cases covered | 7 | 7 | PASS | |
| 13 | +| Error paths covered | 6 | 6 | PASS | |
| 14 | + |
| 15 | +## Traceability |
| 16 | + |
| 17 | +### Design Elements → Tests |
| 18 | + |
| 19 | +| Design Section | Code Location | Test | Edge Cases | Status | |
| 20 | +|----------------|--------------|------|------------|--------| |
| 21 | +| D2: grace_period_secs range (5s-300s) | config.rs:1385-1398 | `test_validate_grace_period_too_low`, `test_validate_grace_period_too_high`, `test_validate_grace_period_in_range` | <5s rejected, >300s rejected, 5-300s accepted | PASS | |
| 22 | +| D3: max_cpu_seconds range (60s-7200s) | config.rs:1400-1413 | `test_validate_max_cpu_too_low`, `test_validate_max_cpu_too_high`, `test_validate_max_cpu_in_range` | <60s rejected, >7200s rejected, 60-7200s accepted | PASS | |
| 23 | +| D4: probe_ttl_secs minimum (≥60s) | config.rs:1415-1423 | `test_validate_probe_ttl_too_short`, `test_validate_probe_ttl_in_range`, `test_validate_no_routing_no_probe_validation` | <60s rejected, ≥60s accepted, no routing = no probe validation | PASS | |
| 24 | + |
| 25 | +### Specification Findings → Tests |
| 26 | + |
| 27 | +| Spec Finding | Test | Status | |
| 28 | +|--------------|------|--------| |
| 29 | +| grace_period_secs field exists | `test_validate_grace_period_*` | PASS | |
| 30 | +| max_cpu_seconds field exists | `test_validate_max_cpu_*` | PASS | |
| 31 | +| probe_ttl_secs on RoutingConfig | `test_validate_probe_ttl_*` | PASS | |
| 32 | +| Validation is additive only | `test_validate_grace_period_in_range`, `test_validate_max_cpu_in_range`, `test_validate_probe_ttl_in_range` all pass alongside existing tests | PASS | |
| 33 | + |
| 34 | +### Error Paths |
| 35 | + |
| 36 | +| Error Variant | Test | Status | |
| 37 | +|--------------|------|--------| |
| 38 | +| AgentFieldOutOfRange (grace_period) | `test_validate_grace_period_too_low`, `test_validate_grace_period_too_high` | PASS | |
| 39 | +| AgentFieldOutOfRange (max_cpu) | `test_validate_max_cpu_too_low`, `test_validate_max_cpu_too_high` | PASS | |
| 40 | +| ProbeTtlTooShort | `test_validate_probe_ttl_too_short` | PASS | |
| 41 | + |
| 42 | +## Gaps Identified |
| 43 | + |
| 44 | +| Gap | Severity | Action | Status | |
| 45 | +|-----|----------|--------|--------| |
| 46 | +| None | - | - | - | |
| 47 | + |
| 48 | +## Validation Tests Added |
| 49 | + |
| 50 | +``` |
| 51 | +test_validate_grace_period_too_low - Rejects grace_period_secs < 5s |
| 52 | +test_validate_grace_period_too_high - Rejects grace_period_secs > 300s |
| 53 | +test_validate_grace_period_in_range - Accepts grace_period_secs in [5, 300] |
| 54 | +test_validate_max_cpu_too_low - Rejects max_cpu_seconds < 60s |
| 55 | +test_validate_max_cpu_too_high - Rejects max_cpu_seconds > 7200s |
| 56 | +test_validate_max_cpu_in_range - Accepts max_cpu_seconds in [60, 7200] |
| 57 | +test_validate_probe_ttl_too_short - Rejects probe_ttl_secs < 60s |
| 58 | +test_validate_probe_ttl_in_range - Accepts probe_ttl_secs ≥ 60s |
| 59 | +test_validate_no_routing_no_probe_validation - Passes when no routing config |
| 60 | +``` |
| 61 | + |
| 62 | +## Integration with Existing Tests |
| 63 | + |
| 64 | +| Existing Test | New Validation Impact | Status | |
| 65 | +|---------------|---------------------|--------| |
| 66 | +| All existing config tests | New validation blocks execute after existing checks | PASS | |
| 67 | +| test_config_validate_gitea_issue_with_workflow_ok | New checks pass (no grace_period/max_cpu set) | PASS | |
| 68 | +| test_config_validate_gitea_issue_requires_workflow | New checks pass (no grace_period/max_cpu set) | PASS | |
| 69 | +| test_validate_model_provider_rejects_bare_banned | New checks pass (provider validation is independent) | PASS | |
0 commit comments