Repository navigation
test: record ADR 0007 accepted regions in the e2e coverage report - #1805
Merged
Merged
Conversation
Adds tests/e2e/fixtures/accepted-regions.json, a reviewed registry of the zero-count regions the browser lane reports that ADR 0007 triages out of browser coverage: 13 data-shape-guard entries and 7 span-drift entries, each with its span as the report prints it and a one-line reason. The reporter counts an accepted region as neither covered nor uncovered, prints the entries in their own section, and lists uncovered regions by span so new entries can be quoted from the report. The 100% source line and 96% source region floors are unchanged. An entry whose span the run now covers or no longer reports is stale and fails the report, and a unit test fails when an entry names a file that no longer exists. Refs cncf#1736 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: mrbobbytables <mrbobbytables@users.noreply.github.com>
✅ Deploy Preview for endusers ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Contributor
There was a problem hiding this comment.
Read the full diff against the tree at merge-base and ran the new test file locally. This looks correct to me.
What I verified:
- Registry validation is strict (
tests/tools/e2e-coverage-report.mjs:558-608):parseAcceptedRegionsrejects non-src/files, malformed spans, unknown classes, empty reasons, and duplicate file+span keys, with the entry index in the error. - Stale detection covers both causes: an accepted span met with
count > 0is pushed tostaleand kept in the denominator (thereturn trueafter the push), and any entry left inpendingAcceptedafter the fold is flaggednot a region this run reports.main()throws on stale entries only afterwriteFileof both artifacts (lines 1218–1219 vs 1291), matching the PR's claim that artifacts survive the failure. - Accepted-region matching runs after the phantom/drift/contradiction folds, so an entry can only consume a zero those folds didn't already remove — the denominator math stays consistent with the existing pipeline.
- Spans spot-check against the actual sources: e.g.
src/components/CaseStudies/index.js:52is thedata.caseStudies || []fallback the registry entry describes. - Node 22 confirmation already happened: the registry was measured on Node 26, but the green "End-to-end coverage" check on this PR is CI's Node 22 run — a span mismatch there would have failed the lane via the stale check, so the 20 entries are confirmed against the CI toolchain.
node --test tests/e2e-coverage-accepted-regions.test.mjs: 8/8 pass locally; CI is fully green.
Docs (ADR 0007 amendment, CONTRIBUTING.md) match the implemented behavior, including the "floors do not move" claim — thresholds are untouched.
No defects found. Note for the maintainer: Refs #1736 is deliberate per the body (that issue tracks the re-filed-findings class); if this PR fully resolves it, it will need a manual close.
— hive: agent=reviewer backend=copilot model=claude-fable-5 copilot=1.0.88
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Makes the ADR 0007 triage of the residual browser-coverage regions machine-readable so the e2e report shows zero uncovered
src/regions and Hive quality agents stop re-filing them (#1736, #1692, #1676 were all this class).tests/e2e/fixtures/accepted-regions.json: 20 entries, each with file, span, ADR 0007 class and a one-line reason (13data-shape-guard, 7span-drift), measured on a fresh lane run at 49ec390.tests/tools/e2e-coverage-report.mjs: accepted zeros are dropped from both numerator and denominator and listed in an "Accepted regions (ADR 0007)" section with their reasons; a new "Uncovered regions" section prints spans so entries can be copied. An accepted region that the lane now covers, or that the build no longer reports, is flagged stale and fails the report after the artifacts are written, so the registry cannot rot.tests/e2e-coverage-accepted-regions.test.mjs(schema, file existence, accepted/not-accepted fixtures, both stale causes, malformed registry). Five copiedvlq/reportArgshelpers in the reporter tests were extracted totests/tools/e2e-coverage-identity-fixture.mjs;CLONE_CEILINGlowered 251 to 245.Report (same run, CI flags)
Validation
npm run test:unit:coverage:check: passRefs #1736