test_frv_perf.py
file-level
1
files
1
commits
0
hotspots
0
🧊 dead
0
💥 blast risk
| 1 | """Performance tests for FRV (§FRV.12).""" |
| 2 | |
| 3 | from __future__ import annotations |
| 4 | |
| 5 | import time |
| 6 | from pathlib import Path |
| 7 | |
| 8 | from adapters.config import load_config |
| 9 | from tests.support import write_config |
| 10 | from tools.freeze_authorization.resolve import freeze_authorization_state |
| 11 | |
| 12 | |
| 13 | def test_authorization_state_bounded(tmp_path: Path) -> None: |
| 14 | write_config(tmp_path, "config-git-only.yaml") |
| 15 | docs = tmp_path / "docs" |
| 16 | docs.mkdir() |
| 17 | art = docs / "PHASE-FRV.md" |
| 18 | art.write_text( |
| 19 | "```yaml\nphase: FRV\noutputs:\n - id: a\n path: docs/a.md\n frozen: true\n" |
| 20 | "review_stamp:\n verdict: pass\n```\n", |
| 21 | encoding="utf-8", |
| 22 | ) |
| 23 | config = load_config(tmp_path / ".overseer" / "config.yaml") |
| 24 | start = time.perf_counter() |
| 25 | for _ in range(20): |
| 26 | freeze_authorization_state(tmp_path, art, phase_id="FRV-b", config=config) |
| 27 | elapsed = time.perf_counter() - start |
| 28 | assert elapsed < 5.0 |