Headless test harness and Gitea Actions CI #18

Closed
opened 2026-11-07 18:27:43 +00:00 by claude · 1 comment
Member

Turn the ad-hoc selftest worldmod used during prototyping into a tests/ world that runs luanti --server, emerges an area, and asserts on:

  • mapgen invariants (surface height, layer contents, light gradient)
  • recipe registry
  • entity spawning
    then shuts down. Run it in Gitea Actions on push, with luacheck as well.
Turn the ad-hoc selftest worldmod used during prototyping into a `tests/` world that runs `luanti --server`, emerges an area, and asserts on: - mapgen invariants (surface height, layer contents, light gradient) - recipe registry - entity spawning then shuts down. Run it in Gitea Actions on push, with luacheck as well.
claude added this to the v0.2 Core Feel milestone 2026-11-07 18:27:43 +00:00
claude added the
type
tech
priority
high
labels 2026-11-07 18:27:43 +00:00
eric added this to the Strata Roadmap project 2026-11-07 18:36:27 +00:00
eric moved this to To Do in Strata Roadmap on 2026-11-07 18:37:23 +00:00
eric closed this issue 2026-11-07 18:51:21 +00:00
Author
Member

Done in 545bc7f.

What changed

  • tests/run.sh [scratch_dir]: builds a throwaway world, exposes the checkout as games/strata via MINETEST_GAME_PATH (works whatever the checkout dir is called), installs the tests/strata_selftest worldmod and runs a dedicated server (luanti --server or luantiserver). Fails on any FAIL line, any ERROR line, a missing TEST summary, a non-zero exit or a timeout. Env knobs: LUANTI, STRATA_TEST_PORT, STRATA_TEST_TIMEOUT, STRATA_TEST_FILTER.
  • strata_selftest: small framework (selftest.register(name, fn, {async=true}), t.assert, t.eq, t.after, t.wrap, t.done). It emerges a fixed-seed area at noon, runs the cases in order, then calls core.request_shutdown.
  • Cases: registry (textures exist, item range ≥ POINT_RANGE, tools never break), mapgen (surface nodes, desert/sand, underground contents, wall layer/backdrop, shadow slab, surface light ≥14 and deep cave air ≤3), crafting (recipes reference registered items/stations, every station craftable, input validation), entities (slime falls and stays on the plane, an ownerless avatar removes itself), player helpers.
  • .luacheckrc plus .gitea/workflows/test.yml: debian:trixie container (Luanti 5.10), luacheck, then the selftest.
  • Docs: tests/README.md, plus README/DESIGN pointers.

Tested: 16/16 cases locally (Luanti 5.10.0) and in a clean debian:trixie container with luantiserver. luacheck: 0 warnings. I also checked that deliberate sync and async failures are reported and fail the run.

Follow-ups: nothing can exercise a real client headless, so the avatar/camera code is tested only through its helpers. Camera and HUD changes still need a manual look.

Done in 545bc7f. **What changed** - `tests/run.sh [scratch_dir]`: builds a throwaway world, exposes the checkout as `games/strata` via `MINETEST_GAME_PATH` (works whatever the checkout dir is called), installs the `tests/strata_selftest` worldmod and runs a dedicated server (`luanti --server` or `luantiserver`). Fails on any `FAIL` line, any `ERROR` line, a missing `TEST summary`, a non-zero exit or a timeout. Env knobs: `LUANTI`, `STRATA_TEST_PORT`, `STRATA_TEST_TIMEOUT`, `STRATA_TEST_FILTER`. - `strata_selftest`: small framework (`selftest.register(name, fn, {async=true})`, `t.assert`, `t.eq`, `t.after`, `t.wrap`, `t.done`). It emerges a fixed-seed area at noon, runs the cases in order, then calls `core.request_shutdown`. - Cases: registry (textures exist, item range ≥ POINT_RANGE, tools never break), mapgen (surface nodes, desert/sand, underground contents, wall layer/backdrop, shadow slab, surface light ≥14 and deep cave air ≤3), crafting (recipes reference registered items/stations, every station craftable, input validation), entities (slime falls and stays on the plane, an ownerless avatar removes itself), player helpers. - `.luacheckrc` plus `.gitea/workflows/test.yml`: `debian:trixie` container (Luanti 5.10), luacheck, then the selftest. - Docs: `tests/README.md`, plus README/DESIGN pointers. **Tested**: 16/16 cases locally (Luanti 5.10.0) and in a clean `debian:trixie` container with `luantiserver`. luacheck: 0 warnings. I also checked that deliberate sync and async failures are reported and fail the run. **Follow-ups**: nothing can exercise a real client headless, so the avatar/camera code is tested only through its helpers. Camera and HUD changes still need a manual look.
eric moved this to Done in Strata Roadmap on 2026-11-07 18:52:01 +00:00
Sign in to join this conversation.