Voting starts in March for the Drupal Association Board election.
When using an install profile that is packaged as a distribution (ie. its projects live in
profiles/[name]/modules) tests in any modules therein cannot be run successfully. To reproduce:
- Install D7 using the standard install profile
- Create a modules directory at
- Move one of the core modules (e.g. poll) from
profiles/standard/modules/polland then clear your caches.
- Run poll tests and watch #fail
While the scenario above is obviously unrealistic, downloading an install profile from Drupal.org that contains, say,
profiles/[name]/modules is a very real case.
The problem is caused by the module whose test is to be run not being available in
drupal_system_listing() given that it lives in a profile directory:
- Views is in
- When Views' tests are run, the install profile used is
standard, leading to the following paths scanned by
- Views is obviously not in any of these directories and so the test fails as it cannot enable Views from the get go.
Some possible approaches,
- Treat this as a UI problem. Don't show any tests for modules in
profiles/[name]/modules. Install profiles and distros would not be able to run tests for any of their modules.
- Always have
$test->profileuse the current install profile if the installed profile is not one of the Drupal core install profiles. Tests will likely take much longer to run, especially when they could just be using the lighter
drupal_system_listing()to use not only
drupal_get_profile()but the 'parent' install profile (the install profile of the site that the test is running on).
PASSED: [[SimpleTest]]: [MySQL] 40,337 pass(es). View
PASSED: [[SimpleTest]]: [MySQL] 37,847 pass(es). View
PASSED: [[SimpleTest]]: [MySQL] 34,195 pass(es). View
PASSED: [[SimpleTest]]: [MySQL] 34,619 pass(es). View
PASSED: [[SimpleTest]]: [MySQL] 34,620 pass(es). View