Held the generator to 981 tests and 92% coverage
Held the generator to 981 test cases at a 92% branch‑coverage floor
with warnings treated as failures, and asserted idempotence by
running the whole build pipeline twice from an empty file and
requiring the second pass to change nothing.
July 2026

Situation. A generator that assembles a database from scratch has a
particular kind of bug: it works the first time and corrupts the
second. Steps that insert without checking, steps that depend on the
order of a previous step's output, steps that are safe alone and not
together. None of that shows up in a test that starts from nothing
and runs once.

Task. The build had to be proved repeatable rather than merely
working, and the test suite had to be large enough and strict enough
that a regression could not pass through it quietly.

Action. The idempotence test is the blunt one and the most useful:
build the entire database from an empty file, snapshot it, run the
whole nineteen‑step pipeline again over the result, and require the
second pass to change nothing. Row counts, contents and identifiers
all have to match. Around it sit 383 test functions — 981 cases once
the parameterised ones expand — across forty‑five files and 7,944
lines, covering the pipeline, the renderers, the content loaders,
the targeting logic and the checkers. Branch coverage carries a
floor of ninety‑two percent enforced in the build rather than
reported in a summary, and the suite currently measures about 95
percent, so the floor has headroom without being decorative.
Warnings are configured as failures, which is the setting that
matters most in practice — a deprecation notice that prints for two
years is a deprecation notice nobody reads, and the run that turns
it into a red test is the run that gets it fixed.

Result. The pipeline can be re‑run against a live database without
fear, which is what makes incremental content work possible at all.
The floor is a floor, not a target, and it is worth saying that
ninety‑two percent branch coverage still leaves branches nothing has
ever taken — the number bounds the risk, it does not remove it, and
two of the defects found later in the project were in code the
coverage report showed as covered.

Categories:
1Databases	/categories/databases/	platform.engineer.company	70
1DevOps	/categories/devops/	platform.engineer.company	70
1Automation & CI/CD	/categories/automation/	platform.engineer.company	70
1Reliability & Backups	/categories/reliability/	platform.engineer.company	70
1Testing & QA	/categories/testing/	platform.engineer.company	70
1Python	/categories/python/	platform.engineer.company	70

Services:
1Backend & API Development	/services/backend-development/	platform.engineer.company	70
1DevOps & CI/CD Automation	/services/devops-cicd/	platform.engineer.company	70
1Technical Leadership & Consulting	/services/technical-leadership/	platform.engineer.company	70

hThis page on the web	URL:https://platform.engineer.company/portfolio/held-the-generator-to-981-tests-and-92-coverage/	platform.engineer.company	70
