five-on-it / apps/worker/src/fuzz
apps/worker/src/fuzz
The generators' random gate (npm run level:fuzz): specs drawn from seeds (@foi/catalogue/testing) built through the whole pipeline (generateLevel, the audit and its repair included, no preview) and held to a bar:
- the generator never throws;
- a spec it refuses is refused at paths the spec has;
- a level it builds has no fault left after its repair, and lost at most 0.5 % of its pieces to it;
- one spec in ten, built twice, is built the same both times.
A failure is one line naming its template and seed, and a file holding the whole spec (--out, fuzz-failures/ by default), which --replay <file> builds again; the specs that ever failed are kept in apps/worker/fuzz-corpus/ and replayed with --corpus. A grid town, a region with towns or a city needs Blender: without it those are skipped and said so.
node apps/worker/src/fuzz.ts [--template region|grid-town|city] [--count 12] [--seed 1] [--towns] [--out dir] [--replay file] [--corpus]