Something went wrong. Try again.
Backend environment for match hosting for lance.blue
Something went wrong. Try again.
README.md
tests #
./scripts/test.sh # from the repo root - the supported way
Everything runs in the image's test stage, so the only requirement on your
machine is Docker, and the tests see exactly the JDK, MegaMek jar and shell that
the build does. The stage either passes or the build fails; nothing is tagged.
| group | what it checks |
|---|---|
lint |
shellcheck, following source into container/lib/common.sh |
syntax |
every .sh parses; the JSON and XML templates parse |
unit |
the container's shell logic against fixtures |
compile |
src/ and tests/src/ compile against the stock MegaMek jar, and the patched jar differs from stock in exactly the patched classes |
What the unit tests cover #
test-manifest-validation.sh— the init scripts reject a malformed launch manifest and say why: unknown version, missingmatchId, a scenario with no digest, expired, duplicate slots, a human with no DID, no humans at all. These are the container's only defence against a bad launch.test-render-config.sh— the Suramadu config renders with no@PLACEHOLDER@left behind. An unsubstituted player name means a client that logs in as@PLAYER_NAME@and sits in the lobby forever.test-perf-shim.sh—suramadu/web/perf.js, the latency instrument served to every player. That it parses (bracket balance;node --checktoo if the machine has node), that nothing is installed above its?perf=1check, that its ring buffer is bounded, thatwindow.__arenaPerfstill exposes what a headless pilot calls, and thatindex.htmlloads it aftersuramadu-init.jsunder an unchanged CSP.test-profiling.sh— the profiler is off unlessARENA_PROFILEis set, and off means the client JVM'svmArgsrender exactly as they did before it existed. Also that the async-profiler pins inversions.envand the Dockerfile's defaults agree, and that finalize reduces Suramadu'sstats,lines into a table.test-deploy.sh— whatscripts/deploy.shrefuses. It writes the release id production is pinned to, so the guards in front of it are the whole point: a dirty tree, and a main that has drifted fromorigin/maineither way. Builds throwaway git repositories, which is why the test stage installsgit; it never builds or pushes anything.test-arena.sh— the decisionsscripts/arena.shmakes around the daemon: the resource caps and their clamping, which containers count as arena's given fakedocker psrows, what the argument parser refuses, and that a start which never serves fails loudly and cleans up.dockerandcurlare stubbed on PATH andDOCKER_HOSTpoints at nothing, so no container is ever started.test-image.sh— howscripts/image.shpicks an image: the commit parsed out of a tag, the selectors that name a build, and what it refuses when a selector matches nothing or matches two. A stubdockerserves a fixture table of tags, so there is no daemon here; the git side is a throwaway repository, because choosing between builds made in the same second is a git question.
Not run by default #
bench.sh— the density benchmark. Takes minutes and wants a quiet machine. It answers a product question (how many matches fit on a box) rather than gating a change.summarize.pyreduces its CSV;heap-sweep.shruns it across a range of heap caps.module-scan.py— reports JDK modules the shipped jars reference that the jlink runtime omits. Run it after bumping MegaMek or Suramadu; a missing module does not fail the build, it fails at runtime far from the cause. Reports rather than passes or fails.profile-summary.py— reduces an async-profiler collapsed file to the EDT's share of the work. Wall-clock sampling records every parked thread, so a raw read of a profile is mostly threads doing nothing; this separates the EDT's waiting from its running and buckets the running part into paint, DirectDraw and PNG encode.tests/shell/test-profile-summary.shcovers it against a fixture, and does run by default.screenshot.py— drives a headless Chrome over CDP to screenshot a running match. How the glyph and layout work was verified. Needs a Chrome already listening on--remote-debugging-port.