docs(selftest): add binding render-path selftest standard

This commit is contained in:
2026-05-30 08:43:06 +02:00
parent 6af9e05664
commit c84891e75d
+48
View File
@@ -0,0 +1,48 @@
# HellionChat SelfTest Standard
These steps run in-game via `/xlperf`. They are HellionChat's real test layer:
Dalamud-coupled classes cannot be instantiated in an xUnit AppDomain, so the
honest verification path is the running plugin, not a headless harness.
## The render-path rule (binding for every step)
A SelfTest exists to catch a broken **runtime** path. To do that it MUST:
1. **ENTRY = the real runtime entry the game calls** per frame or on the real
action — `HonorificHeader.Draw`, `ChunkRenderer.DrawChunks`,
`InputBar.TrySend`, `Sidebar.Draw`, `MessageList.Draw`,
`Lender<PayloadHandler>.Borrow()`. NEVER a helper only the test calls.
2. **ASSERT observable state produced _through_ that entry** — a rendered or
suppressed slot, a set flag, a held vs. sent message. Do NOT re-implement the
helper's logic inside the test and assert against your own copy.
3. **Wire first.** Where the real path does not yet call the correct helper,
wiring it is part of the restoration work; the SelfTest verifies only after.
## Reviewer trick (run before trusting any step)
For every helper a step calls:
```bash
grep -rn '<Helper>' HellionChat/ | grep -v SelfTests | grep -v Tests
```
Zero non-test callers = false-green suspect. The step is passing on dead code.
## The hard gate
Green steps + clean build + clean csharpier are NOT sufficient. In-game smoke
(Linux/Wine, via `/xlperf`) is the true gate. Where headless cannot honestly
verify (scroll state, real send, atlas rebuild, warm object pools), mark the
step explicitly as smoke-only instead of faking a headless pass.
## Anti-pattern of record
`HonorificService.ShouldRenderSlot` had zero production callers and was green
only because the test called it directly — a test passing on a path the game
never runs. That is the failure this standard prevents.
## Step classification
The current real-path / helper-only / mixed classification of every registered
step (with false-green suspects flagged) lives in the Obsidian vault:
`Projekte/FFXIV/Hellion Chat/Audits/HellionChat SelfTest-Klassifikation 2026-05-29.md`.