Repository navigation
test: kill the surviving mutants in the end user data sources - #1789
Conversation
Pins the content-addressed logo name and the exact sanitized SVG bytes,
the hosted_logos directory checks, the snapshot provenance and selection
blocks, the publish backup lifecycle (no backup left after success or
rollback, original error surfaced without a prior output, staged
directories rejected, first publication without a staged tree), every
isSafeAssetPath clause, the manifest shape errors and its sorted,
de-duplicated, newline-terminated bytes, and a stale owned asset that is
already gone from disk. A new tests/landscape-source.test.mjs drives
readLandscape through a PATH git shim to assert the exact clone and
rev-parse arguments, the UTF-8 parse and each rejected revision shape.
The scoped score across the four files rises from 80.48% (433/538, 16
uncovered) to 93.31% (502/538, none uncovered).
The 36 survivors left are equivalent: `|| []` fallbacks replaced with a
string whose properties are undefined (assets L23/L29/L30, landscape
L24/L35, collector L60/L256), optional chaining on values already
guarded by an earlier check (landscape L75/L85/L112-L115, collector
L53), `utf8` encodings that String() and Buffer.from() default to anyway
(assets L53, collector L163/L176), `{ force: true }` on rmSync calls
whose target is known to exist or whose absence is a no-op (assets L89,
collector L304/L307/L312), the output backup and restore steps that
cannot change the published bytes because renameSync is the final
operation (collector L257/L260-L262/L302-L303/L306), and included or
relevant arms made redundant by the throw guards above them (landscape
L87/L91).
Refs cncf#1788
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. |
|
Scanner pass: no findings. The three touched test files ( 🐝 Hive Agent: — hive: agent=scanner backend=copilot model=kimi-k3 copilot=1.0.88 |
There was a problem hiding this comment.
Read the diff against main at ea0388a (three test files, 438 insertions, no source changes) and ran the four touched suites locally after npm ci: enduser-collector, enduser-assets, enduser-landscape, landscape-source — 53/53 pass. The landscape-source tests shim PATH with a stub git driven by LANDSCAPE_SOURCE_* env vars and save/restore the environment afterwards, so nothing touches the network or a real clone. CI's mutation-testing check is green on this head.
The body's list of 36 remaining survivors as equivalent mutants (|| [] fallbacks, default utf8 encodings, { force: true } on known-existing targets, post-renameSync backup steps) reads as plausible; I did not re-run Stryker to confirm each, so treat that list as the author's claim.
Looks correct to me. Fork branch — needs a human merge; checks are already green on this head.
— hive: agent=reviewer backend=copilot model=claude-fable-5 copilot=1.0.88
…rayDeclaration (#1807) Annotate the 41 surviving mutants that the backlog groups in #1788 verified as equivalent (#1789, #1790, #1793, #1794, #1795) with Stryker disable directives that carry the reason, so they report as Ignored instead of Survived and no longer surface as mutation findings. Exclude the ArrayDeclaration mutator in stryker.config.mjs: every instance that survived on main seeded an accumulator or fallback whose contents are unobservable. Hoist the landscape source URL in DirectoryFreshness into a const so its directive can attach outside the JSX. Document the directive placement rules in CONTRIBUTING. Refs #1788 Signed-off-by: mrbobbytables <mrbobbytables@users.noreply.github.com> Co-authored-by: mrbobbytables <mrbobbytables@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Group C of the surviving-mutant backlog in #1788: the end user data sources.
Strengthens the existing unit tests for
scripts/lib/enduser-collector.mjs,scripts/lib/enduser-assets.mjs,scripts/lib/enduser-landscape.mjsandscripts/lib/landscape-source.mjsso each remaining mutant that changes observable behaviour is distinguished: the sanitized-bytes naming of mirrored logos, thehosted_logosdirectory checks, provenance and selection rules recorded verbatim, the readiness gate, first-snapshot publication without a backup, and backup rollback after a failed publication. Test-only change; no source file is modified.Scoped mutation score for the four files: 80.48% (433 killed / 89 survived / 16 no coverage) to 93.31% (502 killed / 36 survived / 0 no coverage).
The 36 survivors left are equivalent mutants that cannot be killed without changing source:
|| []fallbacks replaced with a one-string array whose properties are allundefined, optional chaining on values already guarded by an earlier throw,utf8encodings that are the default,{ force: true }onrmSynccalls whose target is known to exist, and backup/restore steps that run afterrenameSynchas already published the output.Validation: focused tests, scoped Stryker run,
npm run test:unit:coverage:check, and the six lint gates all pass.Refs #1788