Skip to content

test: kill the surviving mutants in the MDX escape and data validators - #1808

Merged
mrbobbytables merged 2 commits into
cncf:mainfrom
mrbobbytables:copilot/mutants-group-f
Oct 22, 2026
Merged

mrbobbytables merged 2 commits into
cncf:mainfrom
mrbobbytables:copilot/mutants-group-f

Conversation

@mrbobbytables

Copy link
Copy Markdown
Member

Summary

Group F of the surviving-mutant backlog: the seven scripts/lib/ files left untriaged after #1788 (mdx-escape, enduser-collector, enduser-landscape, enduser-assets, validate-architecture-assets, validate-utils, profile-image).

  • Tests only in the first commit: 99 survivors reduced to 68, all of them verified equivalent by inspecting the instrumented sandbox (operand-level true/false placement, encoding fallbacks, idempotent sorts and guards that cannot be reached).
  • Second commit marks the 58 non-ArrayDeclaration equivalents with // Stryker disable next-line <Mutator>: <reason> directives (three disable/restore spans where the node sits in a call chain) so they report as Ignored with the reason attached. The remaining 10 ArrayDeclaration survivors are removed by the mutator exclusion in chore: mark the verified equivalent mutants as ignored and exclude ArrayDeclaration #1807.
  • Adds coverage-report-file-region-floor to SOURCE_TEXT_TEST_FILES in stryker.config.mjs: ignored mutants are not instrumented, which skews that harness-over-source test's region ratio inside the sandbox.

Verification

Scoped npm run test:mutation over the seven files: 99.13%, every non-ArrayDeclaration mutant Killed or Ignored. npm run test:unit:coverage:check and the six lint gates pass.

Refs #1788

mrbobbytables and others added 2 commits October 22, 2026 16:44
Pin the grammar decisions in escapeMdx() with fixtures whose code spans
differ between the MDX+GFM, MDX-only and fallback CommonMark views while
staying inert after escaping, so the verification pass cannot mask a wrong
code range: a JSX flow element holding a code span, GFM table rows whose
cell split creates or destroys a span, and list-indented tables that only
one grammar sees as live. Also pin the import/export entries of the
unescape table, the mdx-code-block skip keeping surrounding code verbatim,
and publishLandscapeSnapshot() backing up the previous output before any
staged asset moves. Survivors fall from 40 to 18 in mdx-escape.mjs and
from 19 to 16 in enduser-collector.mjs; the remaining 68 across the seven
files (mdx-escape 18, enduser-collector 16, validate-utils 11,
enduser-landscape 10, validate-architecture-assets 8, enduser-assets 7,
profile-image 3) are equivalent: unreachable branches behind earlier
guards, encoding arguments that default to utf8, rmSync force flags on
paths that always exist, and round-trip checks Date.parse already makes.

Refs cncf#1788

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: mrbobbytables <mrbobbytables@users.noreply.github.com>
…ors as ignored

Add Stryker disable directives for the equivalent survivors documented in
the previous commit: 41 next-line directives plus 3 disable/restore block
pairs where Babel attaches no leading comment (the ISO 8601 regex const,
the roundTrips member chain and the records.push call). The
ArrayDeclaration survivors are left for the global mutator exclusion.

Exclude tests/coverage-report-file-region-floor.test.mjs from the Stryker
dry run: ignored mutants are not instrumented in the sandbox copy, which
shifts the import-only region ratio of validate-utils.mjs below the 50%
floor that test pins on the on-disk source.

Refs cncf#1788

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: mrbobbytables <mrbobbytables@users.noreply.github.com>
@netlify

netlify Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for endusers ready!

Name Link
🔨 Latest commit 0285262
🔍 Latest deploy log https://app.netlify.com/projects/endusers/deploys/6ada8836e17766865270f3ff
😎 Deploy Preview https://deploy-preview-1808--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.

@mrbobbytables
mrbobbytables added this pull request to the merge queue Oct 22, 2026
Merged via the queue into cncf:main with commit 8abcb3f Oct 22, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant