Files
HellionChat/HellionChat/SelfTests/README.md
T

2.3 KiB

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:

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 once had zero production callers and was green only because the test called it directly — a test passing on a path the game never runs. v1.8.7 retired it: the gate is now wired into the real HonorificHeader.Draw and asserted through it via HonorificHeader.LastTitleRendered (see HonorificHeaderRenderStep). Kept here as the canonical example of 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.