Problem/Motivation

One can use a profile which lists modules expecting their dependencies to be installed for install but not for testing because testing enables modules without their dependencies. This fails.

Proposed resolution

Patch simpletest to allow pass $enable_dependencies = TRUE into module_enable for non-core profiles. Also, make module_enable enabled required modules first.

Remaining tasks

Answer the query in #10. That is explain why this fix in necessary for the testing system but not for the other two ways of installing Drupal (drush and install.php).

User interface changes

None.

API changes

New property available in tests.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

chx’s picture

This, however, meant that required modules now might be pulled in via dependencies and they need to bubble to the top.

chx’s picture

Note that there is no test written for this because it would require a whole new profile and that simply doesn't worth it. If you want to test, create a profile:

name = Testfail
description = This will fail simpletest
core = 7.x
dependencies[] = book
boombatower’s picture

Seems like checking for core profiles and defaulting $profileNeedsDependencies to TRUE if not a core profile would be better since most non-core profiles will have things like views and not list out ctools, etc. One less thing people have to worry about.

boombatower’s picture

Issue summary: View changes

Wrote a purdy issue summary.

chx’s picture

FileSize
1.56 KB
1.6 KB
boombatower’s picture

Status: Needs review » Reviewed & tested by the community

Looks fine, I have not tested manually.

catch’s picture

Status: Reviewed & tested by the community » Needs work

This is at least partly the same issue as #1093420: Recursive module dependencies of installation profile are not enabled in DrupalWebTestCase::setUp or #1253774: Dependencies of dependencies are ignored by installation profiles (and by test setUp methods) - would be good to mark the right issues duplicate before committing.

Also:

+      // Required modules must come first. This can only happen during test
+      // install.
+      if (!empty($module_data[$module]->info['required'])) {
+        $module_list[$module] = $module_data[$module]->sort + 10000;
+      }
+      else {
+        $module_list[$module] = $module_data[$module]->sort;
+      }

The comment is not enough to explain why this is necessary - why can it only happen during a test install?

chx’s picture

Status: Needs work » Reviewed & tested by the community

Because required modules are installed during install :) I do not know what else to say. That's why they are required.

catch’s picture

Status: Reviewed & tested by the community » Needs work

Why does it happen in test installs, and not any other kind of install?

chx’s picture

Status: Needs work » Reviewed & tested by the community

Because install does this sorting on its own to batch it.

catch’s picture

Status: Reviewed & tested by the community » Needs work

Discussed this briefly with chx in irc, here's a longer explanation of why this needs work:

There are at least three possible ways to install Drupal:

1. install.php
2. Drush
3. child sites for testing.

Nothing in here explains why this is necessary only for the testing system as opposed to the other two.

Then, if it's only necessary for Simpletest, we'd need a really (really really) good reason to not fix that in the testing system as opposed to adding code to module.inc.

catch’s picture

Issue summary: View changes

Changed to reflect new patch

mgifford’s picture

Assigned: chx » Unassigned
Issue summary: View changes

Version: 8.0.x-dev » 8.1.x-dev

Drupal 8.0.6 was released on April 6 and is the final bugfix release for the Drupal 8.0.x series. Drupal 8.0.x will not receive any further development aside from security fixes. Drupal 8.1.0-rc1 is now available and sites should prepare to update to 8.1.0.

Bug reports should be targeted against the 8.1.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.9 was released on September 7 and is the final bugfix release for the Drupal 8.1.x series. Drupal 8.1.x will not receive any further development aside from security fixes. Drupal 8.2.0-rc1 is now available and sites should prepare to upgrade to 8.2.0.

Bug reports should be targeted against the 8.2.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.6 was released on February 1, 2017 and is the final full bugfix release for the Drupal 8.2.x series. Drupal 8.2.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.3.0 on April 5, 2017. (Drupal 8.3.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.3.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.6 was released on August 2, 2017 and is the final full bugfix release for the Drupal 8.3.x series. Drupal 8.3.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.4.0 on October 4, 2017. (Drupal 8.4.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.4.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.4 was released on January 3, 2018 and is the final full bugfix release for the Drupal 8.4.x series. Drupal 8.4.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.5.0 on March 7, 2018. (Drupal 8.5.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.5.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.6 was released on August 1, 2018 and is the final bugfix release for the Drupal 8.5.x series. Drupal 8.5.x will not receive any further development aside from security fixes. Sites should prepare to update to 8.6.0 on September 5, 2018. (Drupal 8.6.0-rc1 is available for testing.)

Bug reports should be targeted against the 8.6.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.6.x-dev » 8.8.x-dev

Drupal 8.6.x will not receive any further development aside from security fixes. Bug reports should be targeted against the 8.8.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.9.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.7 was released on June 3, 2020 and is the final full bugfix release for the Drupal 8.8.x series. Drupal 8.8.x will not receive any further development aside from security fixes. Sites should prepare to update to Drupal 8.9.0 or Drupal 9.0.0 for ongoing support.

Bug reports should be targeted against the 8.9.x-dev branch from now on, and new development or disruptive changes should be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

quietone’s picture

Component: simpletest.module » phpunit

Triaging issues in simpletest.module as part of the Bug Smash Initiative to determine if they should be in the Simpletest Project or core.

This looks like it a Phpunit issue, changing component.

Version: 8.9.x-dev » 9.2.x-dev

Drupal 8 is end-of-life as of November 17, 2021. There will not be further changes made to Drupal 8. Bugfixes are now made to the 9.3.x and higher branches only. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.2.x-dev » 9.3.x-dev

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.15 was released on June 1st, 2022 and is the final full bugfix release for the Drupal 9.3.x series. Drupal 9.3.x will not receive any further development aside from security fixes. Drupal 9 bug reports should be targeted for the 9.4.x-dev branch from now on, and new development or disruptive changes should be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.9 was released on December 7, 2022 and is the final full bugfix release for the Drupal 9.4.x series. Drupal 9.4.x will not receive any further development aside from security fixes. Drupal 9 bug reports should be targeted for the 9.5.x-dev branch from now on, and new development or disruptive changes should be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

quietone’s picture

This was a bugsmash daily target today. larowlan and myself looked at the issue.

The points raised in #10 have not been addressed. I have updated the remaining tasks and added related issues. I am changing the status because more information is needed to proceed with this issue.

Version: 10.1.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch, which currently accepts only minor-version allowed changes. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.