Problem/Motivation

I *knew* that something like extension_discovery_scan_tests existed and *still* spent close to thirty minutes reverse engineering Drush and Drupal to find it. Yes, it's buried in an example file outside of sites/default which makes it completely invisible and unfindable. Not to mention the wording does not include "testing" or "hidden" so even if you git grep on either, you won't find it. This is untenable and utterly blocks core development. I was vehemently against hiding these modules from the API instead of hiding them from the UI and I was right, as usual.

Proposed resolution

I added to https://www.drupal.org/node/2000204/revisions and this patch adds it everywhere any sane person would look for guidance. A change record was filed at https://www.drupal.org/node/2642834 .

Remaining tasks

User interface changes

API changes

Data model changes

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

chx created an issue. See original summary.

chx’s picture

Priority: Critical » Major
chx’s picture

Issue summary: View changes
FileSize
4.21 KB
dawehner’s picture

+1 to improve the developer experience.

  1. +++ b/core/lib/Drupal/Core/Extension/ExtensionDiscovery.php
    @@ -134,6 +134,12 @@ public function __construct($root, $use_file_cache = TRUE, $profile_directories
    +   * To also find test modules, add
    +   * @code
    +   * $settings['extension_discovery_scan_tests'] = TRUE
    +   * @encode
    +   * to settings.php.
    +   *
        * The information is returned in an associative array, keyed by the extension
    

    Another good place would be the actual documentation of the ExtensionDiscovery class itself.

  2. +++ b/sites/example.settings.local.php
    @@ -79,8 +79,8 @@
    - * During development it can be useful to install test extensions for debugging
    - * purposes.
    + * During development it can be useful to install hidden test extensions for
    + * debugging purposes.
    

    Feels a bit pointless. There is still the concept of hidden modules, so yeah, IMHO there is no point in changing this here.

chx’s picture

FileSize
3.88 KB
jhodgdon’s picture

Status: Reviewed & tested by the community » Needs work

Great idea to add this documentation!

A couple of nitpicks before I think this is ready for commit:

  1. +++ b/core/lib/Drupal/Core/Extension/ExtensionDiscovery.php
    @@ -15,6 +15,13 @@
    + * $settings['extension_discovery_scan_tests'] = TRUE
    

    Probably this should end in a ;

  2. +++ b/core/lib/Drupal/Core/Extension/ExtensionDiscovery.php
    @@ -15,6 +15,13 @@
    + * to settings.php.
    

    A more common place to add this would be in the settings.local file? Also maybe say "to your settings.php file"?

chx’s picture

Status: Needs work » Needs review
FileSize
3.91 KB

Added ; and your. Structuring your settings.php is not the duty of this patch , I will readily presume anyone doing this will have a working knowledge and understanding of "include".

jhodgdon’s picture

Status: Needs review » Needs work
+++ b/core/lib/Drupal/Core/Extension/ExtensionDiscovery.php
@@ -134,6 +141,12 @@ public function __construct($root, $use_file_cache = TRUE, $profile_directories
+   * to settings.php.

misses the added "your" here.

Otherwise, OK. Thanks!

chx’s picture

Status: Needs work » Needs review
FileSize
3.92 KB

Fixed. Happy new year!

chx’s picture

Filed a change notice at https://www.drupal.org/node/2642834 as well because it's a change which passed without notification. Faugh!

jhodgdon’s picture

Status: Needs review » Reviewed & tested by the community

Patch looks good, thanks!

The change record also looks good to me, though it would help if it had an issue link in it... probably not to this issue... I guess we'd have to discover where this change was made. Good enough for now anyway.

Happy new year!

chx’s picture

Issue summary: View changes

I added issue links to the change record.

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 9: 2642824_7.patch, failed testing.

jhodgdon’s picture

Status: Needs work » Reviewed & tested by the community

Test failure was unrelated to this patch. Change record looks great. Thanks!

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed a4f92bb and pushed to 8.0.x and 8.1.x. Thanks!

diff --git a/core/modules/simpletest/src/KernelTestBase.php b/core/modules/simpletest/src/KernelTestBase.php
index 64ac2f0..10463d9 100644
--- a/core/modules/simpletest/src/KernelTestBase.php
+++ b/core/modules/simpletest/src/KernelTestBase.php
@@ -485,7 +485,7 @@ protected function installEntitySchema($entity_type_id) {
   /**
    * Enables modules for this test.
    *
-   * To enable test modules outside of the testing environment, add
+   * To install test modules outside of the testing environment, add
    * @code
    * $settings['extension_discovery_scan_tests'] = TRUE;
    * @encode
diff --git a/core/modules/simpletest/src/WebTestBase.php b/core/modules/simpletest/src/WebTestBase.php
index ca53880..3ad7d56 100644
--- a/core/modules/simpletest/src/WebTestBase.php
+++ b/core/modules/simpletest/src/WebTestBase.php
@@ -1010,7 +1010,7 @@ protected function initKernel(Request $request) {
   /**
    * Install modules defined by `static::$modules`.
    *
-   * To enable test modules outside of the testing environment, add
+   * To install test modules outside of the testing environment, add
    * @code
    * $settings['extension_discovery_scan_tests'] = TRUE;
    * @encode
diff --git a/core/tests/Drupal/KernelTests/KernelTestBase.php b/core/tests/Drupal/KernelTests/KernelTestBase.php
index a724702..f1a1414 100644
--- a/core/tests/Drupal/KernelTests/KernelTestBase.php
+++ b/core/tests/Drupal/KernelTests/KernelTestBase.php
@@ -786,7 +786,7 @@ protected function installEntitySchema($entity_type_id) {
   /**
    * Enables modules for this test.
    *
-   * To enable test modules outside of the testing environment, add
+   * To install test modules outside of the testing environment, add
    * @code
    * $settings['extension_discovery_scan_tests'] = TRUE;
    * @encode

Modules are installed and uninstalled in D8 - there has been some work on updating all the docs in the code base but it is nowhere near complete -but there is no need to add more work. Fixed on commit.

  • alexpott committed 424ed50 on 8.1.x
    Issue #2642824 by chx, jhodgdon: Document extension_discovery_scan_tests...

Status: Fixed » Closed (fixed)

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