Problem/Motivation
We have two InstallerTestBase classes: One extends WebTestBase, and the other extends BrowserTestBase.
We should deprecate the WebTestBase one.
It has two concrete subclasses which should be converted to use Drupal\FunctionalTests\Installer\InstallerTestBase:
Drupal\config\Tests\ConfigInstallProfileUnmetDependenciesTest
Drupal\config_translation\Tests\ConfigTranslationInstallTest
Drupal\system\Tests\Installer\ConfigAfterInstallerTestBase is an abstract subclass which is already deprecated.
Proposed resolution
Convert the tests.
Deprecate Drupal\simpletest\InstallerTestBase in favor of Drupal\FunctionalTests\Installer\InstallerTestBase.
Remaining tasks
User interface changes
API changes
Data model changes
Comments
Comment #2
mile23Comment #3
mile23Comment #4
mile23Comment #5
martin107 commentedAfter following along with the issue summary,
I think this has a sound basis, and is a good small parcel of work to clear our technical debt.
Thanks for marking this out...
I am going to work on this now.
Comment #6
martin107 commentedI am seeing some local test errors, and specifically different between running
phpunit directly as compared to running core/scripts/run-tests.sh
So I am running testbot with a patch I think will fail just to see the authoritative bug report.
I have yet to mark things deprecated etc.
Comment #8
martin107 commentedI can see the problem ....
The fail comes from the mkdir in ConfigInstallProfileUnmetDependenciesTest::setup()
It is a case of a variable being used before being set!
$this->siteDirectorysetup will call parent::setup() as its last act .. where the variable is defined in a call to
$this->prepareDatabasePrefix() [ see TestSetupTrait ]
So things will have to be reordered as they are converted... no biggie... just more tomorrow.
Comment #9
martin107 commentedThe interdiff looks more complicated than it is... so I had better explain.
A) Added trigger and deprecation notices
B) I copied the setUp() function into ConfigInstallProfileUnmetDependenciesTest so that I can insert a single additional function call in the middle of the setup sequence.
which just contains the code that was previously in setup [ see my observaiton in #8 ]
Comment #11
martin107 commentedI now cannot reproduce this error, but it makes sense to copyTestingOverrides after the chmod.
Comment #13
mile23Patch no longer applies.
Comment #14
yogeshmpawarAssigning myself for re-rolling patch because it's untouched from last 18 hours.
Comment #15
yogeshmpawarRe-rolled the patch against 8.6.x branch.
Comment #17
martin107 commentedreroll looks good... thanks yogeshmpawar
I have no idea about the test failure.
Comment #19
lendudeAdded a CR and a 'see' to the deprecation message.
Some unrelated stuff got into the patch in #11 et al., so took that out, and no interdiff because that really wouldn't help here, changes are to big and mostly unrelated.
Simplified
ConfigInstallProfileUnmetDependenciesTest, it's a tricky one that! We can't actually test that UnmetDependenciesException gets thrown since it gets re-thrown as a standard \Exception by\Drupal\Core\Test\HttpClientMiddleware\TestHttpClientMiddleware, so testing for the message will have to suffice I think.Comment #20
mile23For more explicit exception checking we have
Drupal\KernelTests\Core\Config\ConfigInstallTest::testDependencyChecking().It doesn't check the case of profiles, though.
I think the message is specific enough to be useful here, especially since I'm bending my brain trying to figure out how to turn this into a kernel test without success. Maybe a smarter person would do better. :-)
How about adding an inline comment about why we're using Exception instead of UnmetDependenciesException.
8.7.0 now.
The rest looks good.
Comment #21
lendude@Mile23 thanks for the review. We can make the test for UnmetDependenciesException a little better since the class of the exception is added to the message, so we can test for that too.
Comment #22
mile23LGTM.
Comment #23
alexpottI moved it to 8.6.0 since having the tests aligned between 8.6.x and 8.7.x makes bug fixes easier.
Comment #24
alexpottCommitted and pushed 5ba032730b to 8.7.x and 741daa787a to 8.6.x. Thanks!