Problem/Motivation

Follow up of #3523383: Tidy up and tighten deprecation skips.

The DeprecationHandler class was implemented as a replacement of Symfony's PHPUnit-bridge component, and uses initialization logic that is now outdated by more recent PHPUnit developments.

Proposed resolution

In this issue, we will

  1. convert the DeprecationHandler class into a proper PHPUnit 'extension', using the bootstrap logic introduced in PHPUnit 10
  2. introduce proper extension parameters in the phpunit.xml to configure the extension, and a new environment variable that could override the xml configuration at runtime in CI pipelines
  3. make the legacy SYMFONY_DEPRECATION_HELPER variable redundant (still allowing its usage at least for now)
  4. introduce a mechanism to report on each CI job, and finally consolidate at the end of a pipeline execution, statistics about: a) are the deprecation ignore patterns in the .deprecation-ignore.txt file actually necessary and b) are tests marked with the #[IgnoreDeprecations] attribute actually triggering any deprecation. So that with those information we can cleanup tests from irrelevant settings (that could also silently ignore other unexpected deprecations).

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

Issue fork drupal-3523614

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:

Comments

mondrake created an issue. See original summary.

mondrake’s picture

Issue summary: View changes

mondrake’s picture

POC works, see the output at the end of run-tests.sh execution... I "just" need to find a way to consolidate results across different jobs to have a single overall stats board.

mondrake’s picture

Title: Report usage of deprecation ignores during test runs » [PP-2] Report usage of deprecation ignores during test runs
Issue summary: View changes
Related issues: +#3521541: [CI] Components tests coverage metrics differ by PHP version, +#3515704: [CI] Move unit tests to a 'unit tests' stage
mondrake’s picture

Status: Active » Postponed
mondrake’s picture

Title: [PP-2] Report usage of deprecation ignores during test runs » [PP-2] Report count of deprecation skips during test runs
quietone’s picture

Issue summary: View changes

Just a little issue maintenance. Adding what this is postponed on to the remaining tasks per Remining tasks.

mondrake’s picture

Issue tags: +run-tests.sh
mondrake’s picture

Issue tags: +PHPUnit 12
mondrake’s picture

Title: [PP-2] Report count of deprecation skips during test runs » Report count of deprecation skips during test runs
Issue summary: View changes
Status: Postponed » Active
Issue tags: +PHPUnit 11
mondrake’s picture

Title: Report count of deprecation skips during test runs » [CI] Report count of deprecation skips during test runs
Issue summary: View changes
Related issues: +#3497124: Deprecate expectDeprecation(), use PHPUnit's expectUserDeprecationMessage*() instead
mondrake’s picture

Status: Active » Postponed

Version: 11.x-dev » main

Drupal core is now using the main branch as the primary development branch. New developments and disruptive changes should now be targeted to the main branch.

Read more in the announcement.

mondrake’s picture

Issue tags: -PHPUnit 11

mondrake changed the visibility of the branch 3523614-consolidate to hidden.

mondrake’s picture

Title: [CI] Report count of deprecation skips during test runs » [CI] Refactor DeprecationHandler in a standard PHPUnit extension, and collect deprecation statistics
mondrake’s picture

Assigned: Unassigned » mondrake
Issue summary: View changes
Status: Postponed » Active
mondrake’s picture

Issue summary: View changes
mondrake’s picture

Issue summary: View changes
mondrake’s picture

Issue summary: View changes
mondrake’s picture

Status: Active » Postponed

Let's spin off the first 3 point from the IS into an issue of its own.

mondrake’s picture

Title: [CI] Refactor DeprecationHandler in a standard PHPUnit extension, and collect deprecation statistics » [CI] Collect deprecation metrics and report statistics and details
mondrake’s picture

Title: [CI] Collect deprecation metrics and report statistics and details » [CI] Collect and report deprecation statistics and details