Skip to content

test: raise line coverage - #147

Merged
roxblnfk merged 3 commits into
4.xfrom
test/coverage-100
Nov 20, 2026
Merged

roxblnfk merged 3 commits into
4.xfrom
test/coverage-100

Conversation

@roxblnfk

@roxblnfk roxblnfk commented Nov 20, 2026 •

Copy link
Copy Markdown
Member

What was changed

  • New tests cover the readonly-schema, foreign-key and reader-failure paths of Configurator, the reader failures of Embeddings, MergeColumns, MergeIndexes and TableInheritance, a missing related class in the two merge generators, TableInheritance with a big primary key, a wrong outer key, a custom inheritance type, an unregistered parent and an orphan STI field, a foreign key without an outer key, and an enum column whose values come from an enum case.
  • The generators and the relation attributes now also run in the Unit suite; see the review notes for why that matters to Codecov.
  • Line coverage goes from 95.0% to 99.2% locally (Unit + SQLite, Xdebug) and from 92.68% to 99.39% on Codecov; the 5 lines left are listed in the review notes.

Why?

The target is 100% line coverage on Codecov.

Review notes

  • CI collects coverage with pcov, and a file the Unit run never loads still lands in the Unit report with its lines found by static analysis: the function __construct( line, assert() calls and the inner lines of multi-line calls, which pcov never reports for a loaded file. Codecov merges the flags, so these lines stayed missed although SQLite ran them. Running the class in the Unit suite too replaces those lines with pcov's own. The object has to be built inside the test: a data provider runs outside the coverage window, so a constructor called there still counts as missed.
  • Configurator::initColumns() throws "Column name definition is required" only with assertions disabled: the \assert(!empty($propertyName)) right above it fails first for the same input.
  • Unreachable: the !$currentClass instanceof \ReflectionClass exit of Configurator::findOwningEntity() (a property's declaring class is always in its class's hierarchy) and the ReflectionException catch in EntityUtils::findParents() (class_parents() lists only loaded classes).

Checklist

  • Tested
    • Unit + SQLite suites run locally with coverage
    • Unit tests added

@roxblnfk
roxblnfk requested a review from a team November 20, 2026 20:25
@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 99.39%. Comparing base (8dfc1be) to head (7a15568).

Additional details and impacted files
@@            Coverage Diff             @@
##              4.x     #147      +/-   ##
==========================================
+ Coverage   92.68%   99.39%   +6.71%     
==========================================
  Files          39       39              
  Lines         847      824      -23     
==========================================
+ Hits          785      819      +34     
+ Misses         62        5      -57     
Flag Coverage Δ
mysql 90.77% <ø> (ø)
postgres 90.89% <ø> (ø)
sqlite 90.77% <ø> (ø)
sqlserver 90.77% <ø> (ø)
unit 87.37% <ø> (+41.41%) ⬆️

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.

The Unit coverage run never loaded these attribute classes, so Codecov kept counting their constructor lines from static analysis as missed.

Assisted-By: Claude Opus 5.5 <noreply@anthropic.com>
… failure paths

Assisted-By: Claude Opus 5.5 <noreply@anthropic.com>
TableInheritance, MergeColumns and MergeIndexes ran only in the SQLite suite, so the Unit coverage report counted their lines from static analysis, including assert() and multi-line arguments that pcov never reports, and Codecov kept them missed.

Assisted-By: Claude Opus 5.5 <noreply@anthropic.com>
@roxblnfk
roxblnfk merged commit 29900ae into 4.x Nov 20, 2026
22 checks passed
@roxblnfk
roxblnfk deleted the test/coverage-100 branch November 20, 2026 20:59
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