From 56f77080cf9e1d03aeef651e450cd431096d7680 Mon Sep 17 00:00:00 2001 From: Magento EngCom Team Date: Tue, 23 Jan 2018 10:55:22 -0600 Subject: [PATCH] :arrow_double_up: Forwardport of magento/magento2#11499 to 2.3-develop branch Applied pull request patch https://github.com/magento/magento2/pull/11499.patch (created by @joshuaswarren) based on commit(s): 1. bd95e4ec5b909f491afb2b1567fefebdc819b63c Fixed GitHub Issues in 2.3-develop branch: - magento/magento2#10025: Integration tests don't reset the database (reported by @dersam) --- .../framework/Magento/TestFramework/Application.php | 5 +++-- dev/tests/integration/framework/bootstrap.php | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/dev/tests/integration/framework/Magento/TestFramework/Application.php b/dev/tests/integration/framework/Magento/TestFramework/Application.php index a5a16c547e089..bbe0286e29c68 100644 --- a/dev/tests/integration/framework/Magento/TestFramework/Application.php +++ b/dev/tests/integration/framework/Magento/TestFramework/Application.php @@ -444,7 +444,7 @@ public function cleanup() * @return void * @throws \Magento\Framework\Exception\LocalizedException */ - public function install() + public function install($cleanup) { $dirs = \Magento\Framework\App\Bootstrap::INIT_PARAM_FILESYSTEM_DIR_PATHS; $this->_ensureDirExists($this->installDir); @@ -459,8 +459,9 @@ public function install() $installParams = $this->getInstallCliParams(); // performance optimization: restore DB from last good dump to make installation on top of it (much faster) + // do not restore from the database if the cleanup option is set to ensure we have a clean DB to test on $db = $this->getDbInstance(); - if ($db->isDbDumpExists()) { + if ($db->isDbDumpExists() && !$cleanup) { $db->restoreFromDbDump(); } diff --git a/dev/tests/integration/framework/bootstrap.php b/dev/tests/integration/framework/bootstrap.php index 13008938147b5..4e14c8113a708 100644 --- a/dev/tests/integration/framework/bootstrap.php +++ b/dev/tests/integration/framework/bootstrap.php @@ -74,7 +74,7 @@ $application->cleanup(); } if (!$application->isInstalled()) { - $application->install(); + $application->install($settings->getAsBoolean('TESTS_CLEANUP')); } $application->initialize([]);