Problem/Motivation
A number of tests are marked ‘risky’ when PHPUnit is configured to fail in such case.
‘Risky’ tests are those that do not perform any assertion.
In the past, I think there was an assumption that risky tests would flag a failure in Drupal core tests. This is currently not the case since PHPUnit 10 adoption. The configuration file should explicitly have a failOnRisky attribute, which is not the case atm.
Steps to reproduce
Proposed resolution
- Configure PHPUnit to fail when risky tests are run
- Fix the failing tests
Remaining tasks
User interface changes
Introduced terminology
API changes
Data model changes
Release notes snippet
Comments
Comment #3
longwave#2805849: WebAssert does not track assertions, Test marked as risky is semi related, there were no functional fails here but only because BTB explicitly increments the assertion count to avoid risky tests.
Comment #4
mondrakeComment #5
mondrakeComment #6
longwaveThe changes look good but as this is a change to default PHPUnit config it can only go in a minor release and needs a change record.
We probably should backport the test changes without the config change to keep things in sync.
Comment #7
mondrakeAdded draft CR.
Comment #8
smustgrave commentedCR seems straight forward enough but tests appear passing with change to core/phpunit.xml.dist
Comment #13
catchCommitted/pushed to 11.x and cherry-picked without the phpunit.xml change to 11.0.x/10.4.x/10.3.x, thanks!
Comment #15
longwavePublished the CR.