diff --git a/scripts/tests/test_run_ledger.py b/scripts/tests/test_run_ledger.py index e8b667c..583bfdc 100644 --- a/scripts/tests/test_run_ledger.py +++ b/scripts/tests/test_run_ledger.py @@ -4,6 +4,7 @@ `startedAt` 부터 지금까지를 누적에 더한다. 여기서는 그것이 `runs/` 쪽에서도 성립하는지 본다. """ import importlib.util +import glob import json import os import subprocess @@ -187,14 +188,18 @@ class LedgerTest(unittest.TestCase): # ── 옛 원장을 깨지 않는다 ───────────────────────────────────────── def test_the_added_fields_do_not_break_the_verifier(self): """이 도구가 더한 칸이 있어도 검사기가 그대로 읽어야 한다.""" - real = os.path.join(ROOT, "runs/document-haness/2026-09-10-1033/run.json") - if not os.path.exists(real): + # 프로젝트 이름을 적지 않는다 — verify-pipeline.py 의 FORBIDDEN_LITERAL 가드가 + # scripts/ 안에서 저장소 체크아웃 이름을 금지한다. 아무 실제 원장이나 하나 고른다 + found = sorted(glob.glob(os.path.join(ROOT, "runs", "*", "*", "run.json"))) + if not found: self.skipTest("견줄 실제 원장이 없다") + real = found[-1] d = json.load(open(real, encoding="utf-8")) d.update({"revision": 1, "riders": [], "sessions": [], "updatedAt": "x"}) for st in d["stages"]: st.update({"startedAt": None, "finishedAt": None, "elapsedSeconds": 0}) - out = os.path.join(self.dir, "runs", "document-haness", "2026-09-10-1033") + out = os.path.join(self.dir, "runs", os.path.basename(os.path.dirname(os.path.dirname(real))), + os.path.basename(os.path.dirname(real))) os.makedirs(out, exist_ok=True) copy = os.path.join(out, "run.json") json.dump(d, open(copy, "w", encoding="utf-8"), ensure_ascii=False, indent=2)