generated from coulomb/repo-seed
Implement post-triage operational hardening
This commit is contained in:
56
tests/test_daily_triage_verifier.py
Normal file
56
tests/test_daily_triage_verifier.py
Normal file
@@ -0,0 +1,56 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import importlib.util
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
def _load_script():
|
||||
path = Path(__file__).parent.parent / "scripts" / "verify_daily_triage.py"
|
||||
spec = importlib.util.spec_from_file_location("verify_daily_triage", path)
|
||||
assert spec is not None
|
||||
module = importlib.util.module_from_spec(spec)
|
||||
assert spec.loader is not None
|
||||
spec.loader.exec_module(module)
|
||||
return module
|
||||
|
||||
|
||||
def test_daily_triage_verifier_dry_run_names_all_operator_checks() -> None:
|
||||
script = _load_script()
|
||||
args = script.parse_args([
|
||||
"--activity-id",
|
||||
"00000000-0000-0000-0000-000000000123",
|
||||
"--date",
|
||||
"2026-06-04",
|
||||
"--working-memory-dir",
|
||||
"/tmp/wm",
|
||||
])
|
||||
|
||||
report = script.build_dry_run_report(args)
|
||||
|
||||
assert report["mode"] == "dry-run"
|
||||
names = {check["name"] for check in report["checks"]}
|
||||
assert names == {
|
||||
"temporal_schedule",
|
||||
"latest_workflow_history",
|
||||
"activity_runs_row",
|
||||
"state_hub_progress",
|
||||
"working_memory_note",
|
||||
"llm_timeout_budget",
|
||||
}
|
||||
assert report["activity"]["schedule_id"] == (
|
||||
"activity-schedule-00000000-0000-0000-0000-000000000123"
|
||||
)
|
||||
assert any(
|
||||
check.get("path_glob") == "/tmp/wm/daily-triage-2026-06-04-*.md"
|
||||
for check in report["checks"]
|
||||
)
|
||||
timeout_check = next(
|
||||
check for check in report["checks"] if check["name"] == "llm_timeout_budget"
|
||||
)
|
||||
run_check = next(
|
||||
check for check in report["checks"] if check["name"] == "activity_runs_row"
|
||||
)
|
||||
assert "activity_runs.activity_id" in run_check["sql"]
|
||||
assert "where id = '00000000-0000-0000-0000-000000000123'" in timeout_check["sql"]
|
||||
assert timeout_check["activity_timeout_seconds"] == 900
|
||||
assert timeout_check["retry_attempts"] == 10
|
||||
Reference in New Issue
Block a user