Private
Public Access
0
0

docs(workflow): reframe live_gui fragility as authoring-side, not fixture bug

This commit is contained in:
2026-06-05 18:43:58 -04:00
parent 0fec0f4f56
commit dc691e3de0
+2 -2
View File
@@ -420,6 +420,6 @@ In particular, watch for:
- Tests asserting theme color usage: the theme track changed `C_LBL` etc. from `ImVec4` values to callable functions. Tests that assert with `C_LBL` (the function) need to be updated to `C_LBL()` (the call), and they need to patch `src.theme_2.imgui` so the mock's `theme.get_color()` returns the mock's `ImVec4`.
- Tests with production code that builds dicts of theme color callables (e.g. `DIR_COLORS = {"request": C_OUT}`): the dict must store the function, and the use site must call it (`d_col()` not `d_col`). Bug example: `src/gui_2.py:3705-3707` (commit `1469ecac`).
### Live_gui Test Fragility
### Live_gui Test Fragility (Authoring-Side)
`live_gui` is a session-scoped fixture. All tests in a session share the same `sloppy.py` subprocess. Test order matters: a test that triggers deep render paths early in the session "warms up" ImGui state for later tests. Always bisect live_gui test failures by running the test both in the full suite and in isolation to distinguish "needs warmup" from "real bug". See [../docs/guide_testing.md](../docs/guide_testing.md#live_gui-non-determinism) for the full pattern.
`live_gui` is a session-scoped fixture. All tests in a session share the same `sloppy.py` subprocess. A test that "passes when run after test X but fails in isolation" is a **fragile test, not a fragile fixture**. The fixture is session-scoped by design; the test must explicitly wait-for-ready, reset state via Hook API, and verify preconditions via `get_value`/`wait_for_event` rather than assuming a "clean" ImGui state from a prior test. See [../docs/guide_testing.md](../docs/guide_testing.md#authoring-robust-live_gui-tests-dont-assume-clean-state) for the 5-rule authoring contract with anti-pattern vs pattern code examples. Bisect failures by running the test both in the full suite and in isolation to distinguish "test needs work" from "real app bug".