Unit tests for core domain logic (only e2e smoke exists) #2

Closed
opened 2026-09-21 18:47:33 +00:00 by Mark · 1 comment
Owner

tests/e2e.gd is a single integrated smoke test (34 checks, all passing). There are no fine-grained unit tests, so regressions in individual systems are hard to localize from one monolithic pass/fail line.

Landable scope — one test script per system under tests/unit/, runnable headless the same way as the e2e scene:

  • LivingWorld tick scheduler + population cap
  • ManaPool harvest/spend across the 5 planes
  • SkillBook XP/level math
  • Inventory add/remove/stack semantics
  • NetProtocol.validate + Security.require chain (guest vs builder vs admin)
`tests/e2e.gd` is a single integrated smoke test (34 checks, all passing). There are no fine-grained unit tests, so regressions in individual systems are hard to localize from one monolithic pass/fail line. Landable scope — one test script per system under `tests/unit/`, runnable headless the same way as the e2e scene: - `LivingWorld` tick scheduler + population cap - `ManaPool` harvest/spend across the 5 planes - `SkillBook` XP/level math - `Inventory` add/remove/stack semantics - `NetProtocol.validate` + `Security.require` chain (guest vs builder vs admin)
Mark closed this issue 2026-09-22 16:11:01 +00:00
Author
Owner

Closed via commit 1b5ae81.

Added tests/unit/ with five standalone headless scenes (one per system):

  • test_mana_pool.tscn (42 checks)
  • test_skill_book.tscn (42 checks)
  • test_inventory.tscn (36 checks)
  • test_net_protocol_security.tscn (62 checks)
  • test_living_world.tscn (16 checks)

Total: 198 fine-grained checks across the 5 systems.

Each scene mirrors the existing e2e.gd pattern (PASS/FAIL lines + a UT_RESULT summary line + non-zero exit on any failure), so they slot into CI alongside the e2e smoke. .forgejo/workflows/ci.yml now has a Unit tests step that runs tests/unit/test_*.tscn; README.md lists the commands.

Closed via commit 1b5ae81. Added `tests/unit/` with five standalone headless scenes (one per system): - `test_mana_pool.tscn` (42 checks) - `test_skill_book.tscn` (42 checks) - `test_inventory.tscn` (36 checks) - `test_net_protocol_security.tscn` (62 checks) - `test_living_world.tscn` (16 checks) Total: 198 fine-grained checks across the 5 systems. Each scene mirrors the existing `e2e.gd` pattern (PASS/FAIL lines + a `UT_RESULT` summary line + non-zero exit on any failure), so they slot into CI alongside the e2e smoke. `.forgejo/workflows/ci.yml` now has a `Unit tests` step that runs `tests/unit/test_*.tscn`; `README.md` lists the commands.
Sign in to join this conversation.
No description provided.