Closed
Description
When even a single integration test is executed, the following files and directories are created:
app/code/Magento
├── TestModuleDirectoryZipCodes
│ ├── etc
│ │ ├── module.xml
│ │ └── zip_codes.xml
│ └── registration.php
├── TestModuleFakePaymentMethod
│ ├── Gateway
│ │ └── Command
│ │ └── DoNothingCommand.php
│ ├── etc
│ │ ├── config.xml
│ │ ├── di.xml
│ │ └── module.xml
│ └── registration.php
└── TestModuleSample
├── composer.json
├── etc
│ └── module.xml
└── registration.php
(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
- Install Magento, e.g.
composer create-project --repository-url=https://repo.magento.com/ magento/project-community-edition .
and so on. - Run all integration tests or create a custom module with nothing but a single integration test.
- Run the test, e.g.
/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
- Only the specified tests should run in isolation.
- Potential production code should not be affected.
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.
Metadata
Metadata
Assignees
Labels
The issue has been fixed in 2.3 release lineGate 2 Passed. Manual verification of the issue description passedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedGate 1 Passed. Automatic verification of issue format passedGate 4. Acknowledged. Issue is added to backlog and ready for developmentThe issue has been reproduced on latest 2.2 releaseThe issue has been reproduced on latest 2.3 release