diff --git a/docs/work/reference/gates.md b/docs/work/reference/gates.md index 2c3196db..9c18c5f8 100644 --- a/docs/work/reference/gates.md +++ b/docs/work/reference/gates.md @@ -23,7 +23,7 @@ scripts/verify.sh <단계> [대상…] [--on here|<호스트>] [--log <이름>] | `docs` | 작업 매뉴얼 검사(`scripts/check-work-docs.py`)와 장부 형식 | 여기(노트북) | | `hooks` | repo 훅·검사기·장부 시험(`python3 -m unittest discover -s scripts/tests`) | 여기 | | `gate …` | 게이트마다 `corepack pnpm ci:gate `, CI env로 | desktop | -| `parts ` | 그 게이트의 명령(`commandIds`)을 하나씩 끝까지. 음성 fixture(`expect: fail`)는 정해진 종료 코드면 통과 | desktop | +| `parts ` | 그 게이트의 명령(`commandIds`)을 `args`와 함께 하나씩 끝까지. 음성 fixture(`expect: fail`)는 `ci:gate`처럼 정해진 종료 코드와 정해진 진단 문구(`expectedDiagnosticId`)가 둘 다 있어야 통과 | desktop | | `script <이름>… [-- 인자…]` | package script를 하나씩(예: `verify:documentation`). `--` 뒤 인자는 script가 하나일 때만 넘긴다(예: `scripts/verify.sh script test:sample-removal -- --feature=`) | desktop | | `exec -- <명령…>` | 명령 하나. 한 테스트 파일(`node scripts/run-vitest.ts run <파일>`)이나 package script가 아닌 node 스크립트 | desktop | | stage id | `config/ci/gates.json` `stages`의 그 단계 `gateIds` 전부 | desktop | diff --git a/scripts/tests/test_verify.py b/scripts/tests/test_verify.py index 4395627a..d22d4924 100644 --- a/scripts/tests/test_verify.py +++ b/scripts/tests/test_verify.py @@ -90,6 +90,45 @@ class StagePlanTest(unittest.TestCase): expected.append(" ".join(words)) self.assertEqual([line.split(": ", 1)[1] for line in result.stdout.splitlines()], expected) + def test_parts_passes_a_negative_fixture_only_with_its_registered_diagnostic(self) -> None: + # run-ci-gate.ts passes an expect=fail command only when it exits with its code and prints its + # diagnostic. parts saw the exit code alone, so a checker broken into an unrelated exit 1 (a + # TypeError) still counted as its negative fixture passing. + contract = gates() + commands = {c["id"]: c for c in contract["commands"]} + gate = next(g for g in contract["gates"] if g["id"] == "FE-GATE-029") + negatives = [commands[c] for c in gate["commandIds"] if commands[c].get("expect") == "fail"] + self.assertTrue(any(c.get("expectedDiagnosticId") for c in negatives)) + with tempfile.TemporaryDirectory() as tmp: + fake = Path(tmp) / "corepack" + # Answers `corepack pnpm -s