-
Notifications
You must be signed in to change notification settings - Fork 18
Integration tests create stub modules in app/code #38
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
Comments
Well... I would classify this as a bug, not a feature request, but this is not my choice to make. |
@magento-engcom-team this is a bug report, not a feature request. I don't have privileges over this repo, maybe you can close this one? |
@Vinai , @miguelbalparda has this been delt with in some other issue (as a bug)? I can still see this happen in Magento 2.3.0 for Amqp module tests and others. |
The number of modules that get created during an integration test run has increased (a lot) instead of decreased. @schmengler and @avstudnitz have worked on a workaround during a contribution day where the modules are deleted again after execution, but I think that is not a proper solution. It should be possible to create the modules somewhere in the integration test sandbox directory, add them to the component registrar, reconfigure the test ObjectManager so their configurations in di.xml are applied, execute the tests and then remove the test modules again. |
@astyczen You can find the workaround Pull Request here: magento/magento2#18459 |
@Vinai , @avstudnitz thank u for information, I will check out the solution from the PR. |
When even a single integration test is executed, the following files and directories are created:
(Note: the module
Magento_TestModuleFakePaymentMethod
is not generated in Magento 2.2.0).This is a problem because running integration tests should not affect the installed Magento instance.
Preconditions
Reproduced on fresh installations of Magento 2.2.0 and 2.2.2. I haven't tried on Magento 2.2.1.
Steps to reproduce
composer create-project --repository-url=https://repo.magento.com/ magento/project-community-edition .
and so on./var/www/example/vendor/phpunit/phpunit/phpunit --configuration /var/www/example/dev/tests/integration/phpunit.xml /var/www/example/app/code/Example/Foo/Test/Integration
Expected result
Actual result
The modules are created in app/code/Magento potentially affect production code and are created independently if they are used in any test.
It should be possible to create the modules under dev/tests/integration/tmp in the sandbox directory and register them in the test process with the component registrar instead, leaving the app/code directory unmodified.
Original Report: magento/magento2#12696 by @Vinai
The text was updated successfully, but these errors were encountered: