Skip to content

test: pin the flaky-run summary explanation in flaky-reporter - #1838

Closed
hivecommons-hive[bot] wants to merge 1 commit into
mainfrom
quality/test-flaky-reporter-mutants
Closed

hivecommons-hive[bot] wants to merge 1 commit into
mainfrom
quality/test-flaky-reporter-mutants

Conversation

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Test Improvement

tests/tools/flaky-reporter.mjs → summaryMarkdown() renders the
GITHUB_STEP_SUMMARY section that tells a reader of a green end-to-end job
which specs flaked, and that the failure behind the retry was real.
tests/flaky-reporter.test.mjs asserted the ## Flaky end-to-end specs
heading and each generated list row — but nothing asserted the explanation
between them.

Measured on main @ 8abcb3f, run locally 2026-10-23 (Node 26.12.0, StrykerJS
tap runner, concurrency: 4):

npx stryker run --mutate 'tests/tools/flaky-reporter.mjs'
→ 46 mutants, 6 survived, score 86.36

86.36 is below this repository's own break: 90 in stryker.config.mjs. The
file is nevertheless at 100% unit line coverage, and the harness floor in
npm run test:unit:coverage:check keeps it there, so no existing gate could
show this.

The six survivors were all string literals: lines 116–118 (the three prose
lines of the explanation) could each be replaced with "", lines 115 and 119
(the blank lines separating it from the heading and from the list) could be
rewritten, and line 148 (this.rootDir = '') could be replaced — with every
test still passing. The whole reason a reader should care about a green job
could be deleted silently.

What this changes

  • tests/flaky-reporter.test.mjs — one new test asserting the whole
    rendering of summaryMarkdown() for a single record, rather than a phrase of
    it, so the explanation and the blank-line structure around it are pinned
    together. The existing per-row and heading assertions are untouched.
  • tests/tools/flaky-reporter.mjs — a one-line
    // Stryker disable next-line StringLiteral on the constructor's
    this.rootDir = '' seed. That survivor is equivalent, not a gap: onBegin
    assigns both rootDir and this.tests, and onEnd reads rootDir only
    when this.tests is non-empty, so the seed is never read. Annotated per the
    equivalent-mutant guidance in CONTRIBUTING.md rather than tested through
    reporter internals.

No production code changes; both files are test-side.

Verification

  • npx stryker run --mutate 'tests/tools/flaky-reporter.mjs': before
    46 mutants / 6 survived / 86.36, after 43 killed / 0 survived / 100.00.
  • npm run test:unit:coverage:check: 3533 passing, 0 failing; src files
    100.00 lines / 100.00 regions, harness files 100.00 lines / 99.78 regions.
  • check:format, check:lint, check:duplication all clean (clone counts
    unchanged at 245 / 34, under their ceilings).

Evidence limitation

No claim is made about end-to-end coverage of this file. The repository's e2e
coverage mechanism (tests/tools/e2e-coverage-report.mjs, the "End-to-end
coverage" job in ci.yml) maps V8 coverage of the built site back to src/
and does not report on tests/tools/. The gap closed here is a unit-test gap,
evidenced by unit mutation only.

Related issue

None — the hive issue relay consolidated two attempts at filing this finding
into unrelated issue #1837 ([strategist] DNS cutover complete but no launch announcement tracked), so the finding is stated in full above instead. Nothing
here depends on an issue being opened.

Scope

Touches tests/flaky-reporter.test.mjs and tests/tools/flaky-reporter.mjs
only. A full-tree mutation baseline on main @ 8abcb3f run for this change
(4211 mutants, 68m) puts every one of the 42 remaining survivors in
scripts/lib/, inside files already claimed by the open held PRs — #1828
(svg-active-content.mjs, 17), #1832 (mdx-active-content.mjs, 10), #1816
(uri-safety.mjs/url-safety.mjs, 7), #1833 (project-assets.mjs, 3) and
#1835 (architecture-pages.mjs, architecture-content.mjs, cncf-wp-api.mjs,
github.mjs, 5). src/ is at 100%. This change is disjoint from all of them,
and from #1818 and #1819, which touch tests/helpers.mjs,
tests/tools/stryker-child-coverage.cjs and the e2e-coverage-run premises —
not this reporter.

— hive: agent=quality backend=copilot model=claude-opus-5 copilot=1.0.88

summaryMarkdown() renders the GITHUB_STEP_SUMMARY section that tells a
reader of a green end-to-end job which specs flaked and that the failure
behind the retry was real. tests/flaky-reporter.test.mjs asserted the
heading and each generated list row, but nothing asserted the explanation
between them, so Stryker left five string mutants alive: the three prose
lines could each be emptied, and the two blank lines separating them from
the heading and the list rewritten, with every test still passing.

Assert the whole rendering for a single record instead of a phrase of it,
which pins the explanation and the blank-line structure together.

The sixth survivor, the constructor's this.rootDir = '' seed, is
equivalent: onBegin assigns both rootDir and this.tests, and onEnd reads
rootDir only when this.tests is non-empty, so the seed is never read.
Annotate it per the equivalent-mutant guidance in CONTRIBUTING.md.

npx stryker run --mutate 'tests/tools/flaky-reporter.mjs'
  before: 46 mutants, 6 survived, 86.36
  after:  43 killed, 0 survived, 100.00

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: quality <280983584+hivecommons-hive[bot]@users.noreply.github.com>
@hivecommons-hive

Copy link
Copy Markdown
Contributor Author

Important

Held for human review by the hive's ACMM level gate.

This PR was opened by the "quality" agent while Hive policy required a human checkpoint for that agent. Agent PRs are held at ACMM L3–L5; an outreach PR that targets a repository this hive does not manage is held at every level because it publishes project-facing communication into someone else's project.

Hive will keep the hold label until a human removes it. Operators can make a deliberate one-off release during an ACMM level change with release_level_holds=true, but level changes never release this hold automatically.

@netlify

netlify Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for endusers ready!

Name Link
🔨 Latest commit acabf24
🔍 Latest deploy log https://app.netlify.com/projects/endusers/deploys/6adb8ed7125d53c55e6a05c0
😎 Deploy Preview https://deploy-preview-1838--endusers.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Read the tree at 8abcb3f, re-ran the new test locally, and verified the equivalence claim. This looks correct to me.

  • tests/flaky-reporter.test.mjs (new test): the asserted string matches summaryMarkdown()'s actual construction at tests/tools/flaky-reporter.mjs:108-123 line for line, including the two blank separator lines and the trailing newline — exactly the spans the 5 surviving string mutants sat on. node --test tests/flaky-reporter.test.mjs: 13/13 pass at the PR head.
  • The // Stryker disable next-line StringLiteral on this.rootDir = '' (tests/tools/flaky-reporter.mjs:148) is justified: onEnd passes rootDir only into flakyRecords(this.tests, this.rootDir) (:168), and flakyRecords reads rootDir only inside .map((test) => describe(test, rootDir)) (:92-95) — with tests still [] (no onBegin), the seed is never read, so the mutant is equivalent, matching the single-line directive scope.
  • Scope claim holds: the diff is additive, two test-side files only, disjoint from the files touched by #1816/#1818/#1819/#1828/#1832/#1833/#1835.

Open question for a maintainer: the red Validate repository / End-to-end coverage checks — this diff touches neither src/ nor anything the e2e coverage job maps; the same two checks are red on nearly every open PR in the queue, so this looks like a base-branch condition rather than this PR's fault, but I did not triage those jobs.

— hive: agent=reviewer backend=copilot model=claude-fable-5 copilot=1.0.88

@mrbobbytables

Copy link
Copy Markdown
Member

Consolidated into #1846 together with the other open tests/tools mutant-pin PRs (#1819, #1838, #1840). The commit is cherry-picked there unchanged on current main.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant