Make mutation checks faster and stricter - #1898
Conversation
…ic-gates # Conflicts: # scripts/mutation/equivalent-mutants.txt # test/shared/merge/attendee-merge/apply.test.ts
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (6)
📝 WalkthroughWalkthroughThis PR updates mutation-testing tooling and documentation, adds nullish type guards, refactors attendee payment lookup, revises payment-reference behavior, and expands exact-output and edge-case coverage across CSV, forms, Square, and UI tests. ChangesMutation Gate Tooling
Nullish Helper Adoption
Domain and Test Coverage
Estimated code review effort: 4 (Complex) | ~60 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
✨ Simplify code
Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@test/features/admin/attendees-edit.test.ts`:
- Around line 180-184: Update the assertion around getAttendeeActivityLog to
replace the native filter/map chain with the repository’s curried collection
utilities from `#fp`, composed functionally. Preserve the existing predicates,
attendee_id/listing_id projection, and expected result.
In `@test/features/admin/calendar-csv.test.ts`:
- Around line 272-320: Strengthen both tests in the “servicing policy” describe
block by replacing broad toContain/not.toContain checks with exact CSV line
assertions using split("\n") and toEqual. Assert the complete header and row
contents, including column order, the service-event label, omitted servicing
ticket URL, retained attendee URL, and logistics columns; use the actual default
values produced by calAttendee/testAttendee.
In `@test/shared/square/client.test.ts`:
- Line 42: Replace each native Array.prototype.map in the debug-log assertions
with the repository’s curried `#fp` mapping utility, composing it with the
call-argument extraction. Apply this in test/shared/square/client.test.ts:42-42,
test/shared/square/payment-link.test.ts:102-105 for the final two calls, and
test/shared/square/payment-link.test.ts:184-187 for the final three calls;
preserve the existing expected values and assertion behavior.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 930f3e79-2734-4925-a27e-a05e222465ad
⛔ Files ignored due to path filters (1)
deno.lockis excluded by!**/*.lock
📒 Files selected for processing (55)
AGENTS.mdTODO.mdbiome.jsondeno.jsondocs/importer-plan.mdscripts/audit-equivalent-mutants.tsscripts/biome-command.tsscripts/biome.tsscripts/mutation/equivalent-audit.tsscripts/mutation/equivalent-mutants.txtscripts/mutation/execution.tsscripts/mutation/ignore.tsscripts/mutation/test-map.tsscripts/precommit-mutation.tsscripts/precommit/mutation-step.tssrc/features/admin/api-groups.tssrc/features/admin/api-holidays.tssrc/features/admin/attendees-edit.tssrc/features/admin/calendar-csv.tssrc/fp.tssrc/shared/db/activityLog.tssrc/shared/db/payment-references.tssrc/shared/forms/rendering.tsxsrc/shared/required-value.tssrc/shared/rest/crud-api.tssrc/shared/runtime.tssrc/shared/square.tssrc/ui/client/admin/bundle-loader.tssrc/ui/client/dom.tstest/features/admin/attendees-edit.test.tstest/features/admin/calendar-csv.test.tstest/fp/collections.test.tstest/lib/test-utils/error-paths.test.tstest/scripts/biome-command.test.tstest/scripts/mutation-equivalent-audit.test.tstest/scripts/mutation-execution.test.tstest/scripts/mutation-step.test.tstest/scripts/mutation-test-map.test.tstest/shared/db/activityLog.test.tstest/shared/db/payment-references.test.tstest/shared/forms/rendering.test.tstest/shared/merge/attendee-merge/checkout-stage-cleanup.test.tstest/shared/rest/crud-api.test.tstest/shared/square/client.test.tstest/shared/square/payment-link.test.tstest/shared/square/request-init.test.tstest/shared/square/rest-transport.test.tstest/shared/square/retrieve-refund.test.tstest/shared/square/webhook.test.tstest/test-utils/db-helpers/listing-forms.tstest/test-utils/form-values.tstest/ui/client/admin/bundle-loader.test.tstest/ui/client/admin/logistics-map-loader.test.tstest/ui/client/admin/markdown-editor-loader.test.tstest/ui/templates/admin/calendar.test.ts
💤 Files with no reviewable changes (4)
- test/lib/test-utils/error-paths.test.ts
- test/ui/client/admin/markdown-editor-loader.test.ts
- test/ui/client/admin/logistics-map-loader.test.ts
- TODO.md
Why
Mutation testing should spend time on changes that could compile and ship. The equivalent-mutant list must also stay accurate, and every direct test for changed source should take part in the mutation gate.
What changed
mutation:audit-equivalentsto reject stale, malformed, or statically invalid equivalent entriesValidation
mise exec -- deno task precommitmise exec -- deno task mutation:audit-equivalents: 428 entries checked, with no stale or statically invalid entriesmise exec -- deno task precommit:mutation: 753 mutations evaluated, 722 detectable mutations killed, 31 equivalents suppressed, and no survivors or timeoutsdeploy/chobble/tickets-tursochecks passedb3b2e690(exact CSV rows for servicing policy, curried#fpcomposition in attendee-edit and Square assertions, shareddebugMessagestest helper)Remaining limitation
The
deploy/chobble/tickets(Deno Deploy) status failed for commitb3b2e690, but the build logs require console access. The Test workflow and the Turso deploy both passed, and the failure was not reproducible locally — a re-run of the Deno Deploy workflow is the next thing to check on a real machine.