Files
le-mystere-professeur-zacus/tests/CLAUDE.md
T
L'électron rare 9f19fed8a1 chore: bump ESP32_ZACUS + nested CLAUDE.md refresh
Submodule bump: 6129375 -> 1a984b0
Pulls in the firmware build fixes pushed to
github.com/electron-rare/ESP32_ZACUS branch
fix/build-arduino-esp32-3.20014 (PR pending review). The
firmware now compiles cleanly and survives boot on the
Freenove ESP32-S3 dev board (verified flash + 30 s
monitor: SD mounted, LittleFS ready, no panic, 90 k UI
frames).

Once the upstream PR is merged to main, the parent pointer
can be re-bumped to ESP32_ZACUS@main without changes.

CLAUDE.md refresh (init-deep follow-up):
- frontend-v3/apps/atelier/CLAUDE.md (new, 61 lines):
  layout map, store responsibilities, lazy-chunk pattern,
  dev-only window hooks, build with --base, anti-patterns.
- desktop/CLAUDE.md (+8 lines): Tests section + npm test
  command + --ignore-scripts install hint.
- tests/CLAUDE.md (+1 line): list test_firmware_bundle.py
  alongside test_runtime3_routes.py.

All nested CLAUDE.md remain within the 30-80 line target
(longest is atelier at 61).
2026-05-03 16:29:47 +02:00

1.5 KiB

Tests

Python unittest suite covering Runtime 3 IR, NPC engine integration, and scenario invariants.

Layout

File / Dir Scope
test_npc_engine.py NPC state machine (triggers, mood, rule firing)
test_npc_integration.py NPC ↔ TTS ↔ phrase bank wiring
test_npc_phrases_schema.py npc_phrases.yaml schema invariants
runtime3/test_runtime3_routes.py Runtime 3 compiler/IR/pivot tests
runtime3/test_firmware_bundle.py E2E pipeline: scenario YAML → IR → firmware bundle JSON (subprocess)

Running

python3 -m unittest discover -s tests           # full suite
python3 -m unittest tests.test_npc_engine       # single module
make runtime3-test                              # via Makefile target

Patterns

  • Use unittest.TestCase, not pytest fixtures (suite is stdlib-only).
  • Load YAML fixtures from game/scenarios/, never inline them — tests must catch drift in real content.
  • For NPC trigger timing tests, inject a fake clock; never rely on time.sleep.
  • Snapshot the compiled Runtime 3 IR in runtime3/ tests — diff failures should point at the offending pivot/zone ID.

Anti-Patterns

  • Mocking compile_runtime3.py output instead of running it on real fixtures
  • Tests that pass when YAML IDs are renamed but downstream consumers break
  • Importing from tools/ without going through public functions
  • Suppressing UnicodeDecodeError on French content — fix the encoding instead