-
Notifications
You must be signed in to change notification settings - Fork 9.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Forwardport] Allow usage of config-global.php when running Integration Tests #18201
[Forwardport] Allow usage of config-global.php when running Integration Tests #18201
Conversation
Hi @mage2pratik. Thank you for your contribution
For more details, please, review the Magento Contributor Assistant documentation |
Hi @sidolov, thank you for the review. |
…ing Integration Tests #18201
Hi @mage2pratik. Thank you for your contribution. |
*/ | ||
private function copyGlobalConfigFile() | ||
{ | ||
$targetFile = $this->_configDir . '/config.local.php'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think config.local.php is the correct file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Original Pull Request
#16361
When running Integration Tests (
bin/magento dev:tests:run integration
), you will need to customize a couple of files to properly setup the testing environment. Part of this procedure is customizing thephpunit.xml
which also defines a fileTESTS_GLOBAL_CONFIG_FILE
(pointing to eitheretc/config-global.php
oretc/config-global.php.dist
). However, configuration files defined in thisTESTS_GLOBAL_CONFIG_FILE
never end up in the sandbox environment. This issue was also encountered in another issue #15196With this PR, the
TESTS_GLOBAL_CONFIG_FILE
is actually put to use. TheTESTS_GLOBAL_CONFIG_FILE
is picked up properly by the existing bootstrap and then passed on to the constructor of the testing application class. Next, theinstall()
method of the application class is run. This is where the bug occurs. The internal variable$this->globalConfigFile
is never used. This PR adds the actual usage of this variable.Fixed Issues
Manual testing scenarios
dev/tests/integration/tmp/sandbox-*
. Theetc/config.php
file in this sandbox should include the entries from eitheretc/config-global.php
oretc/config-global.php.dist
. However, it does not.etc/config.local.php
file in the sandbox now should include the entries from theetc/config-global.php
file. And this is merged together with theetc/config.php
, containing all of the modules added through the Magento setup procedure.Contribution checklist