Problem/Motivation
Since PHPUnit 10, process isolation must be specified on a single class level or as a global CLI/config switch.
This would cause issues because Drupal needs to run Unit tests NOT in isolation for performance reasons.
For that purpose, workarounds were introduced to programmatically set process isolation in the test constructor.
However, in PHPUnit 12 that is no longer possible as the test constructor can no longer be overridden, and trying to intervene in the setUp() method is already too late for process isolation.
The #[RunTestsInSeparateProcesses] attribute works but needs to be set on each concrete test class, it can not be specified on abstract base classes.
Proposed resolution
In this issue, introduce a check that throws a deprecation if the #[RunTestsInSeparateProcesses] attribute is not specified on the concrete Functional/FunctionalJavascript test class, and fix leftovers.
Remaining tasks
User interface changes
API changes
Data model changes
Release notes snippet
| Comment | File | Size | Author |
|---|
Issue fork drupal-3550335
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:
- 3550335-check-that-runtestsinseparateprocesses
changes, plain diff MR !13413
Comments
Comment #2
mondrakeComment #3
mondrakeComment #5
mondrakeComment #6
mondrakeComment #7
smustgrave commentedDo we have another example of doing such a quick deprecation?
Comment #8
mondrakeI do not know, but see #3546029-4: Ensure that #[RunTestsInSeparateProcesses] attribute is added to all Kernel tests and following comments.
Comment #9
smustgrave commentedLeft a comment but guess this one needs release manager sign off too.
Comment #10
mondrakeComment #11
mondrakeComment #12
mondrakeSee #3546029-25: Ensure that #[RunTestsInSeparateProcesses] attribute is added to all Kernel tests.
Comment #13
smustgrave commentedMarking per the decision made in #3546029: Ensure that #[RunTestsInSeparateProcesses] attribute is added to all Kernel tests
Comment #14
needs-review-queue-bot commentedThe Needs Review Queue Bot tested this issue. It no longer applies to Drupal core. Therefore, this issue status is now "Needs work".
This does not mean that the patch necessarily needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.
Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.
Comment #15
mondrakeHey, bot...
Comment #18
catchCommitted/pushed to 11.x, thanks!
Made a small update to the wording of the deprecation message prior to commit.
Comment #22
alexpottFYI #3556315: Current approach to ensuring RunTestsInSeparateProcesses is added does not work