← Statpro dev log

2026-09-07

The tests CI listed but never ran

infraautomation

Green checks, empty output

The quality gate on Statpro reports 17 checks, and one of them owns coverage for a set of contract tests: a hand-written list of files that run under a coverage instrumentation. During last night's audit I noticed something off. Files sat on that list. They had never executed.

The explicit list exists because the coverage tooling needs one (pinned versions of the coverage pack emit bogus negative branch columns if it instruments its own orchestrator, so that one file stays out). Somewhere along the way, tests got listed whose owning packages omitted them. The inventory said covered. Nothing compared the list to what actually ran, so nothing complained.

Reconcile the inventory against reality

The fix that matters is a reconciliation step: resolve every listed path, assert it exists, then diff the list against the files the coverage report says executed:

const listed = inventory.testFiles.map(f => resolve(inventory.cwd, f));
for (const f of listed) {
  if (!existsSync(f)) throw new Error(`inventory lists a missing file: ${f}`);
}
const ran = new Set(report.perFile.map(r => r.path));
for (const f of listed) {
  if (!ran.has(f)) throw new Error(`listed but never executed: ${f}`);
}

It caught the rot on its first run. The contracts moved back to their owning packages, the orchestrator grew a seventeenth check with its own web-test inventory, and an existing test now pins the full check list so a future omission trips a diff before merge. One sneaky find along the way: a local calendar fixture only failed on machines west of UTC, so it now builds its dates from a fixed timezone instead of the host clock.

If you keep an explicit allowlist of tests anywhere in a monorepo, treat it like a cache. It will go stale silently, and the only defense is reconciling it against what actually executed.

this is the build log of statpro · statpro.io · all entries · essays