From 230ad874ca549b1add320829f873046e78d71f18 Mon Sep 17 00:00:00 2001 From: DongHyeonka Date: Thu, 10 Sep 2026 15:39:14 +0900 Subject: [PATCH] =?UTF-8?q?fix(tests):=20=EC=9B=90=EC=9E=A5=20=ED=9A=8C?= =?UTF-8?q?=EA=B7=80=EA=B0=80=20=ED=94=84=EB=A1=9C=EC=A0=9D=ED=8A=B8=20?= =?UTF-8?q?=EC=9D=B4=EB=A6=84=EC=9D=84=20=EC=A0=81=EC=A7=80=20=EC=95=8A?= =?UTF-8?q?=EA=B2=8C=20=ED=95=9C=EB=8B=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit verify-pipeline.py 의 FORBIDDEN_LITERAL 가드가 scripts/ 안에서 저장소 체크아웃 이름을 금지한다. B-005 의 회귀가 그 이름으로 실제 원장을 찾다가 PIPELINE CONTRACT 를 FAIL 로 만들었다. glob 으로 아무 원장이나 고르게 바꿨고 시험의 뜻은 그대로다 — 더한 칸이 있어도 검사기가 읽는가. 병합에서 드러난 계약 충돌이라 통합 브랜치에서 조정한다. Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_01GksxvQvM6A85xy8viYtWk6 --- scripts/tests/test_run_ledger.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) 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)