Skip to content

Commit 0366781

Browse files
committed
12696 Don't delete test module files if tests are run in parallel
Without this check, the module files were deleted when the first test runner finishs. The second test runner might still need the module files.
1 parent 4e44cb9 commit 0366781

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

dev/tests/integration/framework/bootstrap.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,15 @@
1919
define('INTEGRATION_TESTS_DIR', $testsBaseDir);
2020
}
2121

22-
$testFrameworkDir = __DIR__;
23-
require_once 'deployTestModules.php';
24-
2522
try {
2623
setCustomErrorHandler();
2724

2825
/* Bootstrap the application */
2926
$settings = new \Magento\TestFramework\Bootstrap\Settings($testsBaseDir, get_defined_constants());
3027

28+
$testFrameworkDir = __DIR__;
29+
require_once 'deployTestModules.php';
30+
3131
if ($settings->get('TESTS_EXTRA_VERBOSE_LOG')) {
3232
$filesystem = new \Magento\Framework\Filesystem\Driver\File();
3333
$exceptionHandler = new \Magento\Framework\Logger\Handler\Exception($filesystem);

dev/tests/integration/framework/deployTestModules.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
*/
66

77
/**
8-
* @var $testFrameworkDir string - Must be defined in parent script.
8+
* @var string $testFrameworkDir - Must be defined in parent script.
9+
* @var \Magento\TestFramework\Bootstrap\Settings $settings - Must be defined in parent script.
910
*/
1011

1112
/** Copy test modules to app/code/Magento to make them visible for Magento instance */
@@ -39,7 +40,10 @@
3940
include $file;
4041
}
4142

42-
register_shutdown_function('deleteTestModules', $pathToCommittedTestModules, $pathToInstalledMagentoInstanceModules);
43+
if (!$settings->get('TESTS_PARALLEL_THREAD', 0)) {
44+
// Only delete modules if we are not using parallel executions
45+
register_shutdown_function('deleteTestModules', $pathToCommittedTestModules, $pathToInstalledMagentoInstanceModules);
46+
}
4347

4448
/**
4549
* Delete all test module directories which have been created before

0 commit comments

Comments
 (0)