Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
From @alexpott's review in #2304461-141: KernelTestBaseTNG™:
+++ b/core/tests/Drupal/Tests/KernelTestBase.php
@@ -0,0 +1,1178 @@
+ protected $runTestInSeparateProcess = TRUE;
Nice - I didn't know this was possible - we should have a followup to do the same for BrowserTestBase. And @dawehner thank you for leaving this in. Regardless of the debate about whether this is correct the fact that run-tests.sh runs every test in a separate process means that at least this is making the PHPUnit runner behave the same way.
Proposed resolution
Add protected $runTestInSeparateProcess = TRUE;
to BrowserTestBase
.
Remaining tasks
- Patch
- Review
User interface changes
None
API changes
Comment | File | Size | Author |
---|---|---|---|
#8 | 2494735-8.patch | 2.38 KB | hussainweb |
#8 | interdiff-5-8.txt | 2.21 KB | hussainweb |
Comments
Comment #1
larowlanNice
Comment #2
hussainwebUpdating the IS for clarity.
Comment #3
hussainwebI am guessing this is the only thing required?
Comment #4
tstoeckler@hussainweb: yes I think so.
One minor issue with the documentation:
+ * Kernel tests are run in separate processes to prevent collisions between
Should be "Browser tests".
Comment #5
hussainwebThanks @tstoeckler for the review. Fixed.
Comment #6
dawehnerLooks perfect for me.
Comment #7
alexpottFrom Drupal\simpletest\BrowserTestBase - lets remove this and the annotations from the tests and add in the protected property that can disable preserving global state.
Comment #8
hussainwebFixed for reviews in #7.
Comment #9
bojanz CreditAttribution: bojanz at Centarro commentedComment #10
alexpottCommitted 34fda85 and pushed to 8.0.x and 8.1.x. Thanks!
Fixed this on commit... patches should not change file modes to 755.