Skip to content

12696 Delete all test modules after integration tests #18459

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

Merged

Conversation

avstudnitz
Copy link
Contributor

Description

Several test modules are created on the fly during startup of every
integration test run, but they are never deleted. This PR
changes this, modules are deleted when the process ends.

Things we thought about but didn't implement:

  • Putting the modules into dev/tests/integration/tmp/*/app/code/: we'd need to modify the autoloader and the component registrar which might have caused side effects. Plus, the approach we tried didn't work out.
  • Leave the modules in dev/tests/integration/_files and register them from there: same as above.
  • Remove the modules from a dev/tests/integration/framework/removeTestModules.php: PhpUnit doesn't offer an option to run a script after all tests have been executed.

Fixed Issues

  1. Integration tests create stub modules in app/code #12696: Integration tests create stub modules in app/code

Manual testing scenarios

  1. Run any integration test
  2. Verify that during the test run, some directories names TestModule*, i.e. TestModuleSample, exist in app/code/Magento (they are created automatically when the tests are started).
  3. Verify that those directories are gone after the tests have ended.

Contribution checklist

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • All automated tests passed successfully (all builds on Travis CI are green)

Several test modules are created on the fly during startup of every
integration test run, but they have never been deleted. This commit
changes this, modules are deleted when the process ends
Without this check, the module files were deleted when the first test
runner finishs. The second test runner might still need the module files.
@avstudnitz
Copy link
Contributor Author

I added a check, so the modules are NOT deleted if the integration tests are run parallelly.

@mhauri mhauri self-requested a review October 8, 2018 13:48
Copy link

@mhauri mhauri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @avstudnitz thank you for your contribution, can you please fix the issues from the static tests?

FILE: deployTestModules.php

Line: 45 | Line exceeds maximum limit of 120 characters; contains 121 characters
Line: 66 | Expected 1 newline at end of file; 0 found

@avstudnitz
Copy link
Contributor Author

@mhauri Resolved. Thanks @sidolov for doing the changes.

@magento-engcom-team
Copy link
Contributor

Hi @mhauri, thank you for the review.
ENGCOM-3132 has been created to process this Pull Request

@danslo
Copy link
Contributor

danslo commented Jan 17, 2019

Did this ever manage to get merged? I can't see internal ENGCOM-3132.

@okorshenko
Copy link
Contributor

Hi @danslo
We did 13 attempts to deliver this change, but unfortunately, these changes can't pass our internal automated tests. Our team is working on improvements to this solution to align it with our internal testing infrastructure. Latest progress update on this PR was 13 hours ago

@danslo
Copy link
Contributor

danslo commented Jan 17, 2019

Thanks for the update!

Copy link
Member

@sivaschenko sivaschenko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a fatal error duirng integration tests run:

[Integration-10-ce] PHP Fatal error:  Uncaught Magento\Framework\Exception\FileSystemException: The "/var/www/html/app/code/Magento/TestModuleWysiwygConfig/etc/adminhtml/di.xml" file doesn't exist. in /var/www/html/lib/internal/Magento/Framework/Filesystem/File/Read.php:76
[Integration-10-ce] Stack trace:
[Integration-10-ce] #0 /var/www/html/lib/internal/Magento/Framework/Filesystem/File/Read.php(62): Magento\Framework\Filesystem\File\Read->assertValid()
[Integration-10-ce] #1 /var/www/html/lib/internal/Magento/Framework/Filesystem/File/Read.php(52): Magento\Framework\Filesystem\File\Read->open()
[Integration-10-ce] #2 /var/www/html/lib/internal/Magento/Framework/Filesystem/File/ReadFactory.php(44): Magento\Framework\Filesystem\File\Read->__construct('/var/www/html/a...', Object(Magento\Framework\Filesystem\Driver\File))
[Integration-10-ce] #3 /var/www/html/lib/internal/Magento/Framework/Config/FileIterator.php(69): Magento\Framework\Filesystem\File\ReadFactory->create('/var/www/html/a...', 'file')
[Integration-10-ce] #4 /var/www/html/lib/internal/Magento/Framework/Config/Reader/Filesystem.php(147): Magento\Framework\Config\FileIterator->current()
[Integration-10-ce] #5 /var/www/html in /var/www/html/lib/internal/Magento/Framework/Filesystem/File/Read.php on line 76
[Integration-0-b2b] b2b Integration Integration 0-1 exit code: 0

@nmalevanec could you please help to resolve this problem

@ghost ghost assigned sivaschenko Apr 28, 2019
@nmalevanec nmalevanec force-pushed the 12696/delete-test-modules branch from ec1a6b4 to 2ff2c4e Compare May 3, 2019 10:05
squash! Fix integration tests run.
@nmalevanec nmalevanec force-pushed the 12696/delete-test-modules branch from 5dcc36f to d039298 Compare May 10, 2019 08:46
@m2-assistant
Copy link

m2-assistant bot commented May 31, 2019

Hi @avstudnitz, thank you for your contribution!
Please, complete Contribution Survey, it will take less than a minute.
Your feedback will help us to improve contribution process.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants