Problem/Motivation

  • If you have the minimal profile it is not possible to run Drupal\standard\Tests\StandardTest
  • If you have the standard profile it is not possible to run Drupal\minimal\Tests\MinimalTest
  • Currently testbots are not running Drupal\minimal\Tests\MinimalTest since the test running site has Standard installed

Proposed resolution

This was broken by #2188661: Extension System, Part II: ExtensionDiscovery. We have competing expectations of unused installation profile's module tests not appearing and being able to run tests contained within unused installation profiles. This patch ensures and tests that all tests are runnable with no dependency on the current installation profile.

Remaining tasks

Review

User interface changes

None

API changes

None

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

alexpott’s picture

Issue summary: View changes
Status: Active » Needs review
FileSize
1.28 KB
2.31 KB

If we set the profilesDirectory property to an empty array on the ExtensionListing object then it will scan all profiles.

sun’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: -Needs tests +Testing system
Parent issue: » #2188661: Extension System, Part II: ExtensionDiscovery

Well-spotted! The added test assertion looks sufficient and good to me.

I already questioned this when I studied the code in the ExtensionDiscovery patch. But somehow, the previously existing code in HEAD was using drupal_system_listing() — whereas that was a wrapper around SystemListingInfo, which operated on the current list of installation profiles only.

In other words, the ExtensionDiscovery patch performed a straight conversion of the existing test discovery code in simpletest.module. Looks like some other patch wrongly changed that code to use SystemListingInfo in the past already.

The last submitted patch, 1: 2217781.1.will-fail.patch, failed testing.

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 1: 2217781.1.patch, failed testing.

alexpott’s picture

Issue summary: View changes
Status: Needs work » Needs review
FileSize
3.66 KB
4.1 KB

So it looks like we have competing expectations. OtherInstallationProfileModuleTestsTest is testing that tests in unused installation profiles are not available. I think this expectation is incorrect. We should be able to run all available tests.

The attached patch refactors OtherInstallationProfileModuleTestsTest to meet this expectation and renames it OtherInstallationProfileTestsTest.

sun’s picture

+    // Assert the existence of a test for an uninstalled profile.
...
+    // Assert the existence of a test for a module in an uninstalled profile.
#
+      // Ensure that tests in uninstalled profiles can be discovered.
...
+    // Ensure that tests in uninstalled profiles can be discovered.

Hm, you're (at least consistently) using the term "uninstalled" in these comments, but the "install/uninstall" terminology does not really mesh so well with installation profiles.

In simpletest.module, let's change the wording to this:

"Ensure that tests in all profiles are discovered."

In the test, let's change the wording to this:

"Assert the existence of a test in a different installation profile than the current."

(or shorter, if you find a way to shorten it)

alexpott’s picture

FileSize
2.06 KB
4.15 KB

Makes sense.

sun’s picture

Status: Needs review » Reviewed & tested by the community

Thanks!

catch’s picture

Status: Reviewed & tested by the community » Fixed

Committed/pushed to 8.x, thanks!

Status: Fixed » Closed (fixed)

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