aorecomp

Anarchy Online classic in the browser

git clone https://aorecomp.ubeagle.com/code/aorecomp.git


commit 673cc6d2a9a4e321477236ca86420cf2bca9f6b5
parent bb33b8c61bf0841ccc566c7ffbe469e0c346b7e1
Author: anon <anon@example.com>
Date:   Thu,  5 Nov 2026 04:33:04 +0000

Plan lightweight default Go tests and opt-in asset embedding

Diffstat:
MTODO.md | 28++++++++++++++++++++++++++++
1 file changed, 28 insertions(+), 0 deletions(-)

diff --git a/TODO.md b/TODO.md @@ -124,6 +124,34 @@ rewriting this document does not close them. ## P1: bounded follow-up work +- [ ] **Use external assets by default; make single-executable bundling opt-in.** + The assets directory currently occupies about 1.2 GB and is unconditionally + embedded into the server/test build. Default development builds should read + `./assets/` through the existing `fs.FS` boundary. Select the embedded provider + with an explicit build tag such as `embedassets`; a runtime flag cannot remove + compile/link costs or embedded bytes. Keep both providers on the same resource + paths and serving/loading code. Document the external directory layout and + launch working directory; resolve test asset roots before fixtures change + directory. Completion: the default server and tests do not embed the large + asset tree; the tagged executable runs without external assets; representative + resource reads and HTTP responses agree in both modes. Update build/release + instructions and resource tests to cover both providers. +- [ ] **Make `cd server && go test .` a lightweight development check.** + Measure compile/link time and binary size, package initialization, and test + execution separately before attributing the delay to embedding alone. + `gamedata` also embeds about 145 MB of definitions and eagerly loads/validates + catalogs in `init`; default fixtures call production server initialization. + Remove unnecessary full-world/catalog setup from focused tests and keep + genuinely expensive world/catalog/integration checks in an explicit suite, + preserving their assertions and a documented command to run them. Browser + scenarios remain opt-in through the separate end-to-end suite. Do not achieve + speed by silently dropping coverage or merely requiring `-short` for normal use. + Completion: on the documented development machine, a warm-build-cache run of + `go test -count=1 .` completes within 30 seconds without browsers or the bundled + asset tree; record cold-build timing separately and verify a focused test does + not pay for unrelated world initialization. Explain standard Go output behavior: + plain `go test .` reports passing package results at completion; `-v` enables + per-test output once compilation and package initialization finish. - [ ] **Separate browser scenarios from Go internals through a test-only API.** Put browser scenarios and end-to-end assertions in JavaScript under `tests/e2e/`, reusing `tools/client/game_test.mjs`. A shared Playwright fixture