fix(codecov): leave eval()'d code out of coverage - #379
Merged
Merged
Conversation
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
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
This was referenced Oct 1, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🔍 What was changed
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; theis_file()result is cached per path for the whole run.Foo.php(64) : eval()'d codeunder thesrcprefix, 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