Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix test turning warnings into ErrorExceptions #6089

Closed
wants to merge 1 commit into from

Conversation

staabm
Copy link
Contributor

@staabm staabm commented Dec 20, 2024

Fixes

1) /home/runner/work/phpunit/phpunit/tests/end-to-end/regression/5764/5764.phpt
Failed asserting that string matches format description.
--- Expected
+++ Actual
@@ @@
 
 1) No tests found in class "PHPUnit\TestFixture\Issue5764\Issue5764Test".
 
-No tests executed!
+No tests executed!
+
+Fatal error: Uncaught ErrorException: file(Standard input code): Failed to open stream: No such file or directory in /home/runner/work/phpunit/phpunit/vendor/phpunit/php-code-coverage/src/Data/RawCodeCoverageData.php:270
+Stack trace:
+#0 [internal function]: PHPUnit\TextUI\Application::{closure:/home/runner/work/phpunit/phpunit/tests/end-to-end/regression/5764/error-handler.php:10}()
+#1 /home/runner/work/phpunit/phpunit/vendor/phpunit/php-code-coverage/src/Data/RawCodeCoverageData.php(270): file()
+#2 /home/runner/work/phpunit/phpunit/vendor/phpunit/php-code-coverage/src/Data/RawCodeCoverageData.php(256): SebastianBergmann\CodeCoverage\Data\RawCodeCoverageData->getEmptyLinesForFile()
+#3 /home/runner/work/phpunit/phpunit/vendor/phpunit/php-code-coverage/src/Data/RawCodeCoverageData.php(106): SebastianBergmann\CodeCoverage\Data\RawCodeCoverageData->skipEmptyLines()
+#4 /home/runner/work/phpunit/phpunit/vendor/phpunit/php-code-coverage/src/Data/RawCodeCoverageData.php(59): SebastianBergmann\CodeCoverage\Data\RawCodeCoverageData->__construct()
+#5 /home/runner/work/phpunit/phpunit/vendor/phpunit/php-code-coverage/src/Driver/XdebugDriver.php(117): SebastianBergmann\CodeCoverage\Data\RawCodeCoverageData::fromXdebugWithoutPathCoverage()
+#6 /home/runner/work/phpunit/phpunit/vendor/phpunit/php-code-coverage/src/CodeCoverage.php(169): SebastianBergmann\CodeCoverage\Driver\XdebugDriver->stop()
+#7 Standard input code(47): SebastianBergmann\CodeCoverage\CodeCoverage->stop()
+#8 [internal function]: {closure:Standard input code:43}()
+#9 {main}
+  thrown in /home/runner/work/phpunit/phpunit/vendor/phpunit/php-code-coverage/src/Data/RawCodeCoverageData.php on line 270

/home/runner/work/phpunit/phpunit/tests/end-to-end/regression/5764/5764.phpt:21
/home/runner/work/phpunit/phpunit/src/Framework/TestSuite.php:369
/home/runner/work/phpunit/phpunit/src/Framework/TestSuite.php:369
/home/runner/work/phpunit/phpunit/src/TextUI/TestRunner.php:64
/home/runner/work/phpunit/phpunit/src/TextUI/Application.php:210

refs sebastianbergmann/php-code-coverage@c41f730#commitcomment-150604845

@staabm
Copy link
Contributor Author

staabm commented Dec 20, 2024

I was not able to reproduce the error locally, but I guess the PR should fix it

@staabm
Copy link
Contributor Author

staabm commented Dec 20, 2024

looking at the commit which added the test makes me feel uneasy:
3b58e65#diff-f87e0db621128793460028267b9aa872d359ed51c913d18f9cffcf7d6a0b40a2R3

it reads like we want to play save with tooling registering a "wrong error handler", which mean we should better revert sebastianbergmann/php-code-coverage@c41f730 in case we still thing like that

staabm referenced this pull request in sebastianbergmann/php-code-coverage Dec 20, 2024
Copy link

codecov bot commented Dec 20, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.40%. Comparing base (e4e732d) to head (f1f1f2b).

Additional details and impacted files
@@            Coverage Diff            @@
##               10.5    #6089   +/-   ##
=========================================
  Coverage     94.40%   94.40%           
  Complexity     6464     6464           
=========================================
  Files           681      681           
  Lines         20501    20501           
=========================================
  Hits          19353    19353           
  Misses         1148     1148           

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

@sebastianbergmann
Copy link
Owner

we should better revert sebastianbergmann/php-code-coverage@c41f730

I think so, too.

@sebastianbergmann
Copy link
Owner

Thank you for your contribution. I appreciate the time you invested in preparing this pull request. However, I have decided not to merge it.

@staabm staabm deleted the fix-test branch December 20, 2024 16:47
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.

3 participants