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

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

larowlan’s picture

Nice

hussainweb’s picture

Issue summary: View changes

Updating the IS for clarity.

hussainweb’s picture

Status: Active » Needs review
FileSize
582 bytes

I am guessing this is the only thing required?

tstoeckler’s picture

Status: Needs review » Needs work

@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".

hussainweb’s picture

Status: Needs work » Needs review
FileSize
555 bytes
583 bytes

Thanks @tstoeckler for the review. Fixed.

dawehner’s picture

Status: Needs review » Reviewed & tested by the community

Looks perfect for me.

alexpott’s picture

Status: Reviewed & tested by the community » Needs work
 * All BrowserTestBase tests must have two annotations to ensure process
 * isolation:
 * - @runTestsInSeparateProcesses
 * - @preserveGlobalState disabled

From Drupal\simpletest\BrowserTestBase - lets remove this and the annotations from the tests and add in the protected property that can disable preserving global state.

hussainweb’s picture

Status: Needs work » Needs review
FileSize
2.21 KB
2.38 KB

Fixed for reviews in #7.

bojanz’s picture

Status: Needs review » Reviewed & tested by the community
alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed 34fda85 and pushed to 8.0.x and 8.1.x. Thanks!

diff --git a/core/modules/simpletest/src/BrowserTestBase.php b/core/modules/simpletest/src/BrowserTestBase.php
old mode 100644
new mode 100755

diff --git a/core/modules/simpletest/tests/src/Functional/BrowserTestBaseTest.php b/core/modules/simpletest/tests/src/Functional/BrowserTestBaseTest.php
old mode 100644
new mode 100755

diff --git a/core/tests/Drupal/Tests/Core/Form/FormCacheTest.php b/core/tests/Drupal/Tests/Core/Form/FormCacheTest.php
old mode 100644
new mode 100755

Fixed this on commit... patches should not change file modes to 755.

  • alexpott committed 224c447 on 8.1.x
    Issue #2494735 by hussainweb: add $runTestInSeparateProcess = TRUE for...

  • alexpott committed 34fda85 on
    Issue #2494735 by hussainweb: add $runTestInSeparateProcess = TRUE for...

Status: Fixed » Closed (fixed)

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