Skip to content

fix(codecov): leave eval()'d code out of coverage - #379

Merged
roxblnfk merged 1 commit into
1.xfrom
fix/codecov-eval-pseudo-files
Oct 2, 2026
Merged

roxblnfk merged 1 commit into
1.xfrom
fix/codecov-eval-pseudo-files

Conversation

@roxblnfk

@roxblnfk roxblnfk commented Oct 2, 2026 •

Copy link
Copy Markdown
Member

🔍 What was changed

  • Coverage no longer lists code without a file of its own (eval()'d code, runtime-created functions, assert/regexp code, stdin, vfs://) or any path missing on disk as a source file. Both Xdebug and PCOV drivers drop these entries; the is_file() result is cached per path for the whole run.
  • Before, Xdebug reported Foo.php(64) : eval()'d code under the src prefix, so it reached every report: on Windows the coverage-xml file became an NTFS alternate data stream, and Infection failed with "Could not find the source file".

Checklist

  • How was this tested:
    • Tested manually: reproduced with Xdebug 3.4 on Windows, the pseudo-file is gone after the fix
    • Unit tests added
    • PCOV not checked, the filter there is defensive

Xdebug reports code run through `eval()` under the calling file's path with a suffix, so it passed the path-prefix filter and every report listed a source file that does not exist: on Windows its name turns into an NTFS alternate data stream, and Infection fails to resolve it from coverage-xml. Both drivers now drop the same pseudo-file names php-code-coverage skips.

Assisted-By: Claude Opus 5.5
@roxblnfk
roxblnfk requested a review from a team as a code owner October 2, 2026 15:38
@codecov

codecov Bot commented Oct 2, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 66.66667% with 3 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
plugin/codecov/src/Internal/Driver/PcovDriver.php 0.00% 1 Missing ⚠️
plugin/codecov/src/Internal/Driver/PseudoFile.php 85.71% 1 Missing ⚠️
...lugin/codecov/src/Internal/Driver/XdebugDriver.php 0.00% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@roxblnfk
roxblnfk merged commit b60fa61 into 1.x Oct 2, 2026
26 of 29 checks passed
@roxblnfk
roxblnfk deleted the fix/codecov-eval-pseudo-files branch October 2, 2026 16:01
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