Skip to content

Commit

Permalink
Ensure that the database is cleared and Magento reinstalled when TEST…
Browse files Browse the repository at this point in the history
…S_CLEANUP is set to enabled
  • Loading branch information
joshuaswarren committed Oct 16, 2017
1 parent 08ec8ce commit bd95e4e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,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);
Expand All @@ -453,8 +453,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();
}

Expand Down
2 changes: 1 addition & 1 deletion dev/tests/integration/framework/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
$application->cleanup();
}
if (!$application->isInstalled()) {
$application->install();
$application->install($settings->getAsBoolean('TESTS_CLEANUP'));
}
$application->initialize([]);

Expand Down

0 comments on commit bd95e4e

Please sign in to comment.