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

#79 - add shutdown functions wrapper to make sure TestModules will be… #93

Merged
merged 2 commits into from
Mar 21, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions dev/tests/integration/framework/deployTestModules.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,26 @@
if ((int)$settings->get('TESTS_PARALLEL_RUN') !== 1) {
// Only delete modules if we are not using parallel executions
// phpcs:ignore Magento2.Functions.DiscouragedFunction
register_shutdown_function(
'executeRegisteringOfDeleteTestModulesOnShutdown',
$pathToCommittedTestModules,
$pathToInstalledMagentoInstanceModules
);
}

/**
* Wrapper for registering the deleteTestModules function on shutdown.
* This wrapper makes sure that we are running the deleteTestModules function after ALL other shutdown functions.
* It prevents issues with SessionManager `register_shutdown_function([$this, 'writeClose']);` -
* which used to be called AFTER modules removing - and Fatal Error was thrown.
*
* @param string $pathToCommittedTestModules
* @param string $pathToInstalledMagentoInstanceModules
*/
function executeRegisteringOfDeleteTestModulesOnShutdown(
$pathToCommittedTestModules,
$pathToInstalledMagentoInstanceModules
) {
register_shutdown_function(
'deleteTestModules',
$pathToCommittedTestModules,
Expand Down
Loading