-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Integration tests create stub modules in app/code #12696
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
Hi @Vinai. Thank you for the report. We are moving your feature request to the special project. You can track this issue here: magento/community-features#38 |
@magento-engcom-team This is not a feature request, but clearly a bug. Please reopen and fix. |
Reopening this, sorry about that. |
The problem with this behavior: I can add app/code/Magento to my |
@Vinai, thank you for your report. |
There is another mayor problem with that. If you use a build pipeline, these modules might go to your production environment as you create a zip of the code after successfully executing integration tests. If that happens, checkout gets broken in your production environment. See: #12679 Of course, people can remove these modules before creating the artifact to deploy but it would help if they will not be created at all. People will probably face this issue the first time and they will get a broken checkout for several hours as the bug is really difficult to figure out. |
The problem is even bigger as soon as queue tests come into play:
Those test modules fire up a "few" queue consumers:
That's one PHP process per entry, hogging resources... |
I am working on this #squashtoberfest |
Hi @Vinai. Thank you for your report.
The fix will be available with the upcoming 2.3.3 release. |
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.
The text was updated successfully, but these errors were encountered: