Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
The test calls \Drupal::service('module_installer')->install(...) and does not check the result to see that the module was installed correctly.
This patch from #1719648: ModuleInstaller::install() should provide more information than simply returning FALSE when a module isn't in the file system shows the installation in fact fails.
Comment | File | Size | Author |
---|---|---|---|
#11 | 2387669-11.patch | 1.72 KB | rpayanm |
#11 | 2387669-interdiff.txt | 575 bytes | rpayanm |
#9 | 2387669-9.patch | 1.97 KB | rpayanm |
#6 | 1719648.31.drupal.module-install-missing-ancillary-config-tests_6.patch | 941 bytes | tadityar |
1719648.31.drupal.module-install-missing-ancillary-config-tests.patch | 941 bytes | joachim | |
Comments
Comment #1
joachim CreditAttribution: joachim commentedComment #2
joachim CreditAttribution: joachim commentedOops.
Test should fail.
Comment #4
almaudoh CreditAttribution: almaudoh commentedThis comment doesn't match the code, the test module referred to is empty. This fails because the
config_existing_default_config_test.yml
is wrongly named, should beconfig_existing_default_config_test.info.yml
. I don't know if this is intentional or not. CMI folks may want to take a look at this.Another test in the class (
::testIntegrationModuleReinstallation
) also does similarModuleInstaller::install()
, maybe we can extend this check to include those.Comment #5
Berdir1. That is wrong, it should be renamed. Tagging Novice to do exactly that, provide a patch with that rename and the test change from the initial patch and then it should be green.
Comment #6
tadityar CreditAttribution: tadityar commentedIs this the file that should be renamed?
Comment #7
BerdirI can't say, the patch doesn't contain it :)
Comment #9
rpayanmTrying...
Comment #10
BerdirRename looks correct, have a look at https://www.drupal.org/documentation/git/configure for configuring git diff so that it picks up the rename as a rename and not a delete/add of a new file.
I believe we no longer add explicit hidden: true to modules in tests/modules folders, as they are automatically hidden (or non-existent, actually) when you're not within a test.
Comment #11
rpayanmConfig git successfully ! Thank you :)
Comment #12
BerdirI think this is good to go, we could also check the other install() call, but I think #1719648: ModuleInstaller::install() should provide more information than simply returning FALSE when a module isn't in the file system will take care of that in a more generic and better way.
RTBC, alexpott will probably want to see this, so assigning to him.
Comment #13
joachim CreditAttribution: joachim commentedThat's correct, #1719648: ModuleInstaller::install() should provide more information than simply returning FALSE when a module isn't in the file system will take care of crashing tests properly when a module install fails ;)
Comment #14
alexpottNice find. Committed 8e7f24f and pushed to 8.0.x. Thanks!