Skip to content

test: kill escaped mutants - #142

Merged
roxblnfk merged 5 commits into
4.xfrom
test/kill-mutants
Nov 20, 2026
Merged

roxblnfk merged 5 commits into
4.xfrom
test/kill-mutants

Conversation

@roxblnfk

Copy link
Copy Markdown
Member

What was changed

  • Tests for annotation defaults and flags, the Configurator (typecast and name resolution, embeddings, column options, relation inverse and collection, foreign keys, reader errors), Entities name resolution, MergeColumns/MergeIndexes copying from mapper, repository, source, scope, parents and children, and table inheritance.
  • The mutation score gate goes from 80% to 96%.
  • Equivalent mutants ignored per method in infection.json: Continue_ in Configurator::initRelations() (properties of a parent entity always come last, so break skips the same ones), Coalesce in Configurator::initColumns() (initField() prefers the explicit column name anyway), ReturnRemoval in MergeColumns::copy() and MergeIndexes::render() (an empty list is a no-op), UnwrapArrayMap in TableInheritance (the STI children map already holds class names), ReturnRemoval/FalseValue in TableInheritance::getParentForForeignKey() (an STI parent shares the root's table and primary key).

Why?

Mutation score on Linux: 83.3% → 98.81%, escaped mutants 85 → 6.

Review notes

The 6 mutants left in TableInheritance point at two bugs, left for separate fixes:

  • getTableName() and getDatabase() look at the immediate parent, not the STI root. A second-level STI child (Ceo → Employee → Person in Fixtures16) is linked to its own table, and SyncTables creates an empty ceos table. Mutants at lines 306 and 325.
  • An STI child of a JTI entity (Square #[SingleTable] → Polygon #[JoinedTable] → Shape) is merged into the root shapes table instead of polygons, and removeStiExtraFields() then drops Polygon's columns from it. The mutants at lines 91, 154, 218 and 220 are only observable in this case, so no test pins it.

Checklist

  • Tested
    • Unit tests added
    • Infection run on Linux (PHP 8.4, SQLite)

Assisted-By: Claude Opus 5.5 <noreply@anthropic.com>
Assisted-By: Claude Opus 5.5 <noreply@anthropic.com>
Assisted-By: Claude Opus 5.5 <noreply@anthropic.com>
Assisted-By: Claude Opus 5.5 <noreply@anthropic.com>
The ignored mutants have no observable effect: a skipped relation property is always followed by more skipped ones, an explicit column name wins inside initField anyway, an empty column or index list is a no-op, the STI children map already holds class names, and an STI parent shares its table and primary key with the root.

Assisted-By: Claude Opus 5.5 <noreply@anthropic.com>
@roxblnfk
roxblnfk requested a review from a team November 20, 2026 17:06
@codecov

codecov Bot commented Nov 20, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.86%. Comparing base (5b0ae8e) to head (f199b54).

Additional details and impacted files
@@            Coverage Diff             @@
##              4.x     #142      +/-   ##
==========================================
+ Coverage   87.28%   91.86%   +4.57%     
==========================================
  Files          39       39              
  Lines         873      848      -25     
==========================================
+ Hits          762      779      +17     
+ Misses        111       69      -42     
Flag Coverage Δ
mysql 90.77% <ø> (+0.12%) ⬆️
postgres 90.89% <ø> (+0.12%) ⬆️
sqlite 90.77% <ø> (+0.12%) ⬆️
sqlserver 90.77% <ø> (+0.12%) ⬆️
unit 44.33% <ø> (+31.62%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@roxblnfk
roxblnfk merged commit 04cd5fe into 4.x Nov 20, 2026
22 checks passed
@roxblnfk
roxblnfk deleted the test/kill-mutants branch November 20, 2026 17:11
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