This repository was archived by the owner on Apr 29, 2019. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +12
-8
lines changed Expand file tree Collapse file tree 4 files changed +12
-8
lines changed Original file line number Diff line number Diff line change @@ -26,8 +26,12 @@ public function run()
26
26
/**
27
27
* {@inheritdoc}
28
28
*/
29
- public function install ()
29
+ public function install ($ cleanup )
30
30
{
31
+ if ($ cleanup ) {
32
+ $ this ->cleanup ();
33
+ }
34
+
31
35
$ installOptions = $ this ->getInstallConfig ();
32
36
33
37
/* Install application */
Original file line number Diff line number Diff line change 58
58
);
59
59
60
60
if (defined ('TESTS_MAGENTO_INSTALLATION ' ) && TESTS_MAGENTO_INSTALLATION === 'enabled ' ) {
61
- if (defined ('TESTS_CLEANUP ' ) && TESTS_CLEANUP === 'enabled ' ) {
62
- $ application ->cleanup ();
63
- }
64
- $ application ->install ();
61
+ $ cleanup = (defined ('TESTS_CLEANUP ' ) && TESTS_CLEANUP === 'enabled ' );
62
+ $ application ->install ($ cleanup );
65
63
}
66
64
67
65
$ bootstrap = new \Magento \TestFramework \Bootstrap (
Original file line number Diff line number Diff line change @@ -435,10 +435,11 @@ public function cleanup()
435
435
/**
436
436
* Install an application
437
437
*
438
+ * @param bool $cleanup
438
439
* @return void
439
440
* @throws \Magento\Framework\Exception\LocalizedException
440
441
*/
441
- public function install ()
442
+ public function install ($ cleanup )
442
443
{
443
444
$ dirs = \Magento \Framework \App \Bootstrap::INIT_PARAM_FILESYSTEM_DIR_PATHS ;
444
445
$ this ->_ensureDirExists ($ this ->installDir );
@@ -453,8 +454,9 @@ public function install()
453
454
$ installParams = $ this ->getInstallCliParams ();
454
455
455
456
// performance optimization: restore DB from last good dump to make installation on top of it (much faster)
457
+ // do not restore from the database if the cleanup option is set to ensure we have a clean DB to test on
456
458
$ db = $ this ->getDbInstance ();
457
- if ($ db ->isDbDumpExists ()) {
459
+ if ($ db ->isDbDumpExists () && ! $ cleanup ) {
458
460
$ db ->restoreFromDbDump ();
459
461
}
460
462
Original file line number Diff line number Diff line change 74
74
$ application ->cleanup ();
75
75
}
76
76
if (!$ application ->isInstalled ()) {
77
- $ application ->install ();
77
+ $ application ->install ($ settings -> getAsBoolean ( ' TESTS_CLEANUP ' ) );
78
78
}
79
79
$ application ->initialize ([]);
80
80
You can’t perform that action at this time.
0 commit comments