Skip to content

Gate on full config_db table coverage - #2571

Draft
ideaship wants to merge 1 commit into
sonic-e2e-v2-evpnfrom
sonic-e2e-v2-coverage-gate
Draft

Gate on full config_db table coverage#2571
ideaship wants to merge 1 commit into
sonic-e2e-v2-evpnfrom
sonic-e2e-v2-coverage-gate

Conversation

@ideaship

@ideaship ideaship commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Part of the series tracked in #2562, which explains the ordering and what each PR covers. Based on the preceding PR in the stack, so review only the top commits here.

Thirty lines, and the reason the coverage number cannot quietly rot: a unit test
asserting that no table the generator can emit is left without a golden.

It closes the one coverage failure nothing else catches — a newly emitted
table arriving with no golden. Coverage lost the other way (a table that had a
golden becoming empty) already fails the golden comparison, because the golden
file itself changes.

It lives in the unit suite rather than the E2E job because it needs neither
NetBox nor a generated config, only the generator source and the committed
goldens. So it costs milliseconds and runs on every change, where the E2E job
runs on a file matcher and a 2400s budget. No .zuul.yaml change is needed.

It lands last because it can only pass once the golden set is complete — which
is what the PR below achieves.

@ideaship ideaship changed the title sonic e2e v2 coverage gate Gate on full config_db table coverage Aug 5, 2026
@berendt
berendt force-pushed the sonic-e2e-v2-coverage-gate branch from 369711b to 34a693a Compare August 5, 2026 15:10
@ideaship
ideaship force-pushed the sonic-e2e-v2-coverage-gate branch from 34a693a to bdf2899 Compare August 5, 2026 19:51
@berendt
berendt force-pushed the sonic-e2e-v2-coverage-gate branch from bdf2899 to 8793a02 Compare August 6, 2026 10:56
@ideaship
ideaship force-pushed the sonic-e2e-v2-coverage-gate branch from 8793a02 to f0dc3b3 Compare August 6, 2026 12:10
tests/e2e/coverage.py reports which config_db tables the golden set
reaches, but nothing consumes it: it is wired into neither
sonic_golden_test.sh nor the Zuul job, so the number is only seen by
someone who runs `make sonic-e2e-coverage` by hand. That is how the
"38 of 38" claim came to exist as an unverifiable one-off in the first
place, and leaving it human-run lets it decay the same way again.

Add a unit test asserting the set of emitted-but-uncovered tables is
empty. It closes the one coverage failure nothing else catches: a newly
emitted table arriving with no golden. Coverage lost in the other
direction -- a table that had a golden becoming empty -- already fails
the golden comparison, because the golden file itself changes, and the
regeneration path is covered separately by the coverage guard in
compare.py.

It belongs in the unit suite rather than the E2E job because it needs
neither NetBox nor a generated config, only the generator source and the
committed goldens. It therefore costs milliseconds and runs on every
change, where the E2E job runs on a file matcher and a 2400s budget.
This needs no .zuul.yaml change: coverage.py already exposes
emitted_tables() and covered_tables().

The assertion message names the missing tables and points at
`make sonic-e2e-regen`, because the cost of this gate is that adding a
generator table now obliges the same change to add golden coverage, and
that is a full regeneration cycle rather than a two-line edit. If a
table genuinely cannot be reached by any fixture, the message says to
exclude it here with a stated reason -- one visible exception, not a
silently growing allowlist.

This lands after the last scenario because it can only pass once the
golden set is complete; the report itself lands with the first goldens,
where it is still useful at 30 of 38.

Assisted-by: Claude:claude-opus-5
Signed-off-by: Roger Luethi <luethi@osism.tech>
@ideaship
ideaship force-pushed the sonic-e2e-v2-coverage-gate branch from f0dc3b3 to 63b1f23 Compare August 6, 2026 12:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: New

Development

Successfully merging this pull request may close these issues.

2 participants