Audit the frontend + backend test suites for gaps, redundancy, and guard coverage. Surfaced while building the World Almanac / server-side-stats work (#60 / PR #72), where a real building-dimension NaN regression slipped through every --project=unit run.
Known findings to start from
-
Golden/equivalence tests don't run in the default suite. bench/layoutGolden.bench.test.ts, bench/decorationGolden.bench.test.ts (and the other bench/*) live in the bench vitest project, which npx vitest run --project=unit / just test-app does not execute (only npm run bench does). So the bit-identical layout guard never runs locally or (verify) in CI. → Decide: run a golden subset in the normal suite/CI, or document the gap.
-
layoutGolden can't guard the stats path. It calls layoutCity({ tree }) with no manifest.stats. After the server-side-stats migration the layout consumes manifest.stats (with a tree-walk only as a degenerate fallback), so the golden test exercises the fallback, not the real path. → Wire representative stats into the golden fixtures and recapture the baseline.
-
Golden fixtures lack edge files. genWeightedTree (tests/_helpers/layoutTreeFixtures) appears to generate no 0-byte, 0-line, or media files — exactly the cases that produced the Math.log(0) → NaN building geometry. → Add fixtures covering empty files, binary/0-line files, and media files.
-
Duplicate / overlapping tests. Tests were added per-task during the World Almanac work without first auditing existing coverage. Check for redundancy (e.g. almanac/overview, layout dimensions, reactiveRebuild, stats) and consolidate.
-
Stats-less layout callers. Confirm no production path calls layoutCity without manifest.stats (currently only the golden bench test does); decide whether the layout should keep a self-contained tree-walk fallback or require stats.
Goal
A test suite where a building-dimension / layout-output change cannot merge green, the golden guards actually run, fixtures cover the size edge-cases, and there's no redundant coverage.
Audit the frontend + backend test suites for gaps, redundancy, and guard coverage. Surfaced while building the World Almanac / server-side-stats work (#60 / PR #72), where a real building-dimension NaN regression slipped through every
--project=unitrun.Known findings to start from
Golden/equivalence tests don't run in the default suite.
bench/layoutGolden.bench.test.ts,bench/decorationGolden.bench.test.ts(and the otherbench/*) live in thebenchvitest project, whichnpx vitest run --project=unit/just test-appdoes not execute (onlynpm run benchdoes). So the bit-identical layout guard never runs locally or (verify) in CI. → Decide: run a golden subset in the normal suite/CI, or document the gap.layoutGoldencan't guard the stats path. It callslayoutCity({ tree })with nomanifest.stats. After the server-side-stats migration the layout consumesmanifest.stats(with a tree-walk only as a degenerate fallback), so the golden test exercises the fallback, not the real path. → Wire representativestatsinto the golden fixtures and recapture the baseline.Golden fixtures lack edge files.
genWeightedTree(tests/_helpers/layoutTreeFixtures) appears to generate no 0-byte, 0-line, or media files — exactly the cases that produced theMath.log(0)→ NaN building geometry. → Add fixtures covering empty files, binary/0-line files, and media files.Duplicate / overlapping tests. Tests were added per-task during the World Almanac work without first auditing existing coverage. Check for redundancy (e.g. almanac/overview, layout dimensions, reactiveRebuild, stats) and consolidate.
Stats-less layout callers. Confirm no production path calls
layoutCitywithoutmanifest.stats(currently only the golden bench test does); decide whether the layout should keep a self-contained tree-walk fallback or require stats.Goal
A test suite where a building-dimension / layout-output change cannot merge green, the golden guards actually run, fixtures cover the size edge-cases, and there's no redundant coverage.