Problem/Motivation

New PHPUnit version 9.5.12 released just now (2022-01-21, see here: https://github.com/sebastianbergmann/phpunit/blob/master/ChangeLog-9.5.md) throws a new, unhandled deprecation notice:

Remaining direct deprecation notices (1)

  1x: The "Drupal\Tests\Listeners\DrupalListener" class implements "PHPUnit\Framework\TestListener" that is deprecated.
    1x in DrupalListener::endTest from Drupal\Tests\Listeners

This causes a lot of existing tests to fail. (See for example: https://www.drupal.org/pift-ci-job/2300826)

Looking here: https://dispatcher.drupalci.org/job/drupal_patches/, it seems there has been no successful build without deprecation notices since #110382, which in my time zone was handled at 21-Jan-2022 05:28:32.
After that build even a testrun with no errors seems to end up with 3,766 failures, which are all the above deprecation notice.

Steps to reproduce

Run a full test run on existing Drupal 9.x and see previously passing tests fail.

Proposed resolution

- Unsure if this is an upstream issue
- To prevent massive test-failures until Big Brains sought that out, we can skip the deprecation notice. This is implemented in MR!1694)

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Issue fork drupal-3259744

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Spokje created an issue. See original summary.

Spokje’s picture

Issue summary: View changes
Spokje’s picture

Status: Active » Needs review
Spokje’s picture

Issue summary: View changes
mondrake’s picture

Status: Needs review » Reviewed & tested by the community

This is the culprit upstream I think: https://github.com/sebastianbergmann/phpunit/commit/9b5a2e5cc9d615ab9b14...

The fix is OK, there's no other way round I think, thanks @Spokje

longwave’s picture

Category: Bug report » Task
Priority: Major » Critical

Thank you @Spokje. From the TestListener docblock:

 * This interface, as well as the associated mechanism for extending PHPUnit,
 * will be removed in PHPUnit 10. There is no alternative available in this
 * version of PHPUnit.

We have to skip the deprecation until we have upgraded to PHPUnit 10, so this is the correct solution for now.

mondrake’s picture

Critical, all testing on D9 and PHP >= 7.3 must be broken ATM

EDIT - xpost with #7

alexpott’s picture

Version: 9.4.x-dev » 9.3.x-dev
Category: Task » Bug report
Status: Reviewed & tested by the community » Fixed

Committed 654b490 and pushed to 10.0.x. Thanks!
Committed f5dc2cb and pushed to 9.4.x. Thanks!
Committed faec13d and pushed to 9.3.x. Thanks!

Well that was fun this MR conflicted with 10.x and 9.3.x :D

  • alexpott committed 654b490 on 10.0.x
    Issue #3259744 by Spokje: PHPUnit 9.5.12 (released 2022-01-21) throws...

  • alexpott committed f5dc2cb on 9.4.x
    Issue #3259744 by Spokje: PHPUnit 9.5.12 (released 2022-01-21) throws...

  • alexpott committed faec13d on 9.3.x
    Issue #3259744 by Spokje: PHPUnit 9.5.12 (released 2022-01-21) throws...
Wim Leers’s picture

Wow, I was just about to start looking for what the hell is going on and then I found it was fixed a minute ago, here, in this issue — this was leading to mysterious failures in #3248177-25: Language toolbar item cannot be removed from the toolbar 😄

Thanks for the super fast fix! 👏

Spokje’s picture

Thanks for the super fast fix! 👏

We aim to please...

Well that was fun this MR conflicted with 10.x and 9.3.x :D

...and slightly annoy core committers ;)

casey’s picture

FileSize
1.11 KB

Fixed patch for usage with composer-patches on 9.3.3 installations

xjm’s picture

Version: 9.3.x-dev » 9.2.x-dev
Status: Fixed » Needs work

Can we get a 9.2.x version of this? It did not cherry-pick cleanly. We need to be able to have passing test runs on 9.2.x since it receives security coverage. :) Thanks!

xjm’s picture

Status: Needs work » Patch (to be ported)
PCate’s picture

Here's (hopefully) a 9.2.12 compatible version of the patch.

Spokje’s picture

Status: Patch (to be ported) » Reviewed & tested by the community

LGTM, RTBC if TestBot returns green.

  • xjm committed 29fdce3 on 9.2.x
    Issue #3259744 by Spokje, PCate, alexpott: PHPUnit 9.5.12 (released 2022...
xjm’s picture

Status: Reviewed & tested by the community » Fixed

Thanks @PCate!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.