Add #[RunTestsInSeparateProcesses] attribute to all Kernel and Functional tests

Created on 4 May 2024, 14 days ago
Updated 9 May 2024, 9 days ago

Problem/Motivation

Process isolation in PHPUnit 10 must be specified on a single class level or as a global switch.

This causes issues because Drupal needs to run Unit tests NOT in isolation for performance reasons.

Proposed resolution

In this issue, explore adding #[RunTestsInSeparateProcesses] attribute to all Kernel and Functional tests, through an automated Rector script.

How to update the MR

  • from a git branch of the MR
  • reset the branch to current 11.x: git reset 11.x --hard
  • install rector: composer require -dev rector/rector
  • revert composer changes: git checkout -- .
  • download the rector config file attached here as rector.php in the root directory, and git ignore it
  • run rector: vendor/bin/rector
  • run PHPCBF to reorder use import statements: vendor/bin/phpcbf --filter=GitModified --standard=Drupal --sniffs=SlevomatCodingStandard.Namespaces.AlphabeticallySortedUses,PSR2.Namespaces.UseDeclaration,PSR2.Namespaces.NamespaceDeclaration,Drupal.Classes.UnusedUseStatement core
  • commit changes to branch
  • force push commit

With over 3k files touched, we should try to avoid making manual changes - rather tune the rector script.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

📌 Task
Status

Closed: won't fix

Version

11.0 🔥

Component
PHPUnit  →

Last updated 22 minutes ago

Created by

🇮🇹Italy mondrake 🇮🇹

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.67.2 2024