Skip to content
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

Ensure database is cleared/Magento reinstalled when TESTS_CLEANUP is enabled #11499

Merged
merged 1 commit into from
Oct 24, 2017

Conversation

joshuaswarren
Copy link

Description

When TESTS_CLEANUP is set to enabled, the database should be cleared and Magento reinstalled each time the integration tests are run. This is the expected behavior and the documented behavior according to http://devdocs.magento.com/guides/v2.2/test/integration/integration_test_execution.html#the-testscleanup-constant

In this pull request, I've added a check for the TESTS_CLEANUP variable which we use and only restore the database from a previous dump (instead of installing from scratch) if TESTS_CLEANUP is not enabled.

Fixed Issues (if relevant)

  1. Integration tests don't reset the database #10025 Integration tests don't reset the database

Manual testing scenarios

  1. Follow the steps in http://devdocs.magento.com/guides/v2.2/test/integration/integration_test_execution.html
  2. Ensure that TESTS_CLEANUP is enabled
  3. Make some manual change to the integration test database
  4. Run the integration tests again
  5. Ensure that your change you made in step 3 is no longer present in the database.

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)

@okorshenko okorshenko self-assigned this Oct 16, 2017
@okorshenko okorshenko added this to the October 2017 milestone Oct 16, 2017
@okorshenko okorshenko added Release Line: 2.2 2.2.x Event: MMNY17 Reproduced on 2.1.x The issue has been reproduced on latest 2.1 release Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release labels Oct 16, 2017
@@ -438,7 +438,7 @@ public function cleanup()
* @return void
* @throws \Magento\Framework\Exception\LocalizedException
*/
public function install()
public function install($cleanup)
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you please take a look at Magento\TestFramework\WebApiApplication::install() this method signature must be compatible with Magento\TestFramework\Application::install($cleanup)

@okorshenko okorshenko merged commit bd95e4e into magento:2.2-develop Oct 24, 2017
okorshenko pushed a commit that referenced this pull request Oct 24, 2017
okorshenko pushed a commit that referenced this pull request Oct 24, 2017
okorshenko pushed a commit that referenced this pull request Oct 24, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Event: MMNY17 Progress: accept Release Line: 2.2 Reproduced on 2.1.x The issue has been reproduced on latest 2.1 release Reproduced on 2.2.x The issue has been reproduced on latest 2.2 release Reproduced on 2.3.x The issue has been reproduced on latest 2.3 release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants