The keycloak project ended with four open questions that design could not
settle. A two-VM lab was built to answer them by measurement, and this is
that material: 26 experiments, 125 raw command outputs, 22 browser captures.
Follows the import procedure in README.md.
source/ the originating repository verbatim — 78 documents, 28 SVGs,
8 manifests, plus .source-revision recording the commit
final/ the SSOT
document.md 729 lines written from the 29 experiment documents, not
concatenated: what was predicted, what was measured, and
where the measurement itself was wrong
evidence/raw 125 outputs, flattened to <experiment>__<file> because
the originals collided (01-baseline.txt appeared three
times) and the audit only globs the top level
evidence/meta one per raw file; command and exitCode are null and the
README says why rather than inventing them
evidence/browser 22 captures
assets/ three diagrams through techviz
.techviz/ their VizSpecs
A separate project rather than an addition to keycloak: the B-layer answers
that project's four questions, but the A, C and D layers are about cluster
failure, SSO and operations, and one document.md should hold one subject.
The four question records there can point here through 관계.
Recorded rather than papered over: only three of the 28 diagrams were
remade. The repository forbids hand-drawn SVG and forbids titles inside the
canvas; all 28 originals carry both, so converting them is redrawing, not
reformatting. They stay in source/ and the gap is written into the document.
verify-pipeline.py passes. audit-records.py reports no issues.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
54 lines
2.5 KiB
Markdown
54 lines
2.5 KiB
Markdown
---
|
|
kind: REFERENCE
|
|
slug: a-contract-test-must-run-the-adapters-statement
|
|
title: 계약 테스트는 어댑터가 실제로 돌리는 statement를 실행해야 한다
|
|
topic: what-a-gate-does-not-prove
|
|
project: clean-architecture-backend-template
|
|
status: 게시 전
|
|
sourceRevision: 21234e38cdb9a926cbc92bb97a2aee2e4a7d2916
|
|
rootTreeNode: reference:a-contract-test-must-run-the-adapters-statement
|
|
verifiedOn: # 이 기록은 이번 회차에 실행 확인을 하지 않았다
|
|
---
|
|
|
|
# 계약 테스트는 어댑터가 실제로 돌리는 statement를 실행해야 한다
|
|
|
|
## 목적
|
|
|
|
테스트가 직접 만든 statement 나 픽스처 경로를 검증하고, 프로덕션 어댑터가 실제로 실행하는 경로는 검증하지 않는 상태를 막는다.
|
|
|
|
## 규칙
|
|
|
|
1. 테스트가 스스로 만든 입력이 아니라 어댑터를 통해 들어간다
|
|
테스트가 SQL 이나 요청을 직접 구성하면 어댑터의 구성 로직이 검증되지 않는다.
|
|
|
|
2. 통과의 이유를 확인한다
|
|
기대한 가드가 아니라 앞선 다른 가드에서 걸려 통과할 수 있다. 예외 타입만 단언하면 둘이 구별되지 않는다.
|
|
|
|
3. 도달 불가 분기를 테스트가 덮고 있는지 본다
|
|
앞선 조건이 그 분기를 막고 있으면, 그 분기를 검증한다는 테스트는 다른 것을 검증하고 있다.
|
|
|
|
4. 픽스처가 이미 정규화한 값을 넣지 않는다
|
|
번역이나 정규화가 검증 대상이면 그 이전 형태를 넣어야 한다.
|
|
|
|
## 적용 조건
|
|
|
|
어댑터 계약 테스트 통합 테스트 그리고 프로덕션 경로를 대표한다고 주장하는 모든 테스트
|
|
|
|
## 예외
|
|
|
|
단위 테스트가 한 함수의 동작만 검증한다고 명시하면 이 규칙의 대상이 아니다. 그 테스트가 계약을 대표한다고 읽히지 않아야 한다.
|
|
|
|
## 예시
|
|
|
|
경로 형태 검증기의 첫 가드가 SINGLE 외 전략을 전부 거부하므로, 다중 타깃 분기를 검증한다는 테스트는 그 앞 가드의 예외로 통과한다. 둘 다 같은 예외 타입이라 구별되지 않는다.
|
|
|
|
번역되지 않은 경합 예외가 재시도 catch 를 비껴갔을 때, 단위 픽스처는 이미 번역된 예외를 던지고 있었다.
|
|
|
|
## 관계
|
|
|
|
- **다중 타깃 검증을 확인한다는 테스트가 다른 가드에 걸려 통과했다**
|
|
이 규칙을 만든 사례다.
|
|
- **번역되지 않은 경합 예외가 재시도 코디네이터의 catch를 통째로 비껴갔다**
|
|
픽스처가 검증 대상을 건너뛴 사례다.
|
|
|