Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
When we fixed #2560643: Fatal PHPUnit tests are not always reported as failure, we introduced a regression where a legitimately failing phpunit test now returns less information that it did before.
http://cgit.drupalcode.org/drupal/tree/core/modules/simpletest/simpletes... is only checking if $ret is anything other than 0, which works for segfaulting or php fatal error issues (they return 139 and 255) but it is also catching normal test failures which returns 1.
If phpunit returns 1, we can safely assume that the xml file was generated and that we should use those results.
Comment | File | Size | Author |
---|---|---|---|
#8 | 2582457-8.phpunit_fail_reporting.patch | 1.39 KB | Mixologic |
#2 | 2582457-2.phpunit_fail_reporting.patch | 805 bytes | Mixologic |
Comments
Comment #2
MixologicComment #3
MixologicComment #4
dawehnerIs there any way to test that? I guess we have simply no chance.
I think we still should run phpunit tests natively.
Here is some advertisment for another issue which would make that possible: #2567029: Be able to run only simpletest tests, but no phpunit, running from run-tests.sh
Comment #5
MixologicWell, one of the ways Im testing it was to resubmit a different patch with this fix in it:
https://www.drupal.org/node/1425588#comment-10425655
Comment #8
MixologicThe test that tests this should test a fail > 1.
Comment #9
tim.plunkettI think that should count.
Comment #10
dawehnerHa, we sort of have a test, it was just wrong :)
Comment #11
alexpottLet's see if this change would have caught #2592367: PHPUnit is broken - we have dependencies on Symfony event dispatcher tests.
Comment #12
dawehnerIt seems to not have caught it?
Comment #13
dawehnerThis is test only
Comment #14
Mixologic#2592367: PHPUnit is broken - we have dependencies on Symfony event dispatcher tests. was actually related to #2580293: Patch having test with "PHP Fatal error" is marked as PASSED. This would not have caught that.
The original issue #2560643: Fatal PHPUnit tests are not always reported as failure only managed to work for PHP Unit tests that Fatal as part of its runtime execution - If it had a compile time Fatal (like a syntax error, or class not found errors) then these fatals did the "disappearing act"
Comment #15
alexpottCommitted cc3ddd4 and pushed to 8.0.x. Thanks!