From 5935d96968d968dfcdd1cceac72fc05bb573c6c6 Mon Sep 17 00:00:00 2001 From: Lukasz Bajsarowicz Date: Tue, 21 Oct 2025 17:24:04 +0200 Subject: [PATCH 1/2] SwiftOtter-SOP-348 Enable Compiled Configuration Cache for Test execution --- .../Magento/TestFramework/Application.php | 31 ++++++++++++------- 1 file changed, 20 insertions(+), 11 deletions(-) diff --git a/dev/tests/integration/framework/Magento/TestFramework/Application.php b/dev/tests/integration/framework/Magento/TestFramework/Application.php index 9cec75e9c4500..2730ae11c1663 100644 --- a/dev/tests/integration/framework/Magento/TestFramework/Application.php +++ b/dev/tests/integration/framework/Magento/TestFramework/Application.php @@ -1,7 +1,7 @@ _shell->execute( - PHP_BINARY . ' -f %s cache:enable -vvv %s %s %s %s --bootstrap=%s', - [ - BP . '/bin/magento', - \Magento\Framework\App\Cache\Type\Config::TYPE_IDENTIFIER, - \Magento\Framework\App\Cache\Type\Layout::TYPE_IDENTIFIER, - \Magento\Framework\App\Cache\Type\Translate::TYPE_IDENTIFIER, - \Magento\Eav\Model\Cache\Type::TYPE_IDENTIFIER, - $initParamsQuery, - ] + PHP_BINARY . ' -f %s cache:enable -vvv %s --bootstrap=%s', + [BP . '/bin/magento', implode(' ', $this->getEnabledCaches()), $initParamsQuery, ] ); // right after a clean installation, store DB dump for future reuse in tests or running the test suite again @@ -596,6 +589,22 @@ public function install($cleanup) } } + /** + * Returns caches that should be enabled during the Integration Tests execution + * + * @return array + */ + private function getEnabledCaches(): array + { + return [ + \Magento\Framework\App\Cache\Type\Config::TYPE_IDENTIFIER, + \Magento\Framework\App\Cache\Type\Layout::TYPE_IDENTIFIER, + \Magento\Framework\App\Cache\Type\Translate::TYPE_IDENTIFIER, + \Magento\Framework\App\Interception\Cache\CompiledConfig::TYPE_IDENTIFIER, + \Magento\Eav\Model\Cache\Type::TYPE_IDENTIFIER, + ]; + } + /** * Run commands after installation configured in post-install-setup-command-config.php * From e6d41326a202a22e7be4ea00fbec8ee08d34b9d2 Mon Sep 17 00:00:00 2001 From: Lukasz Bajsarowicz Date: Tue, 21 Oct 2025 21:03:06 +0200 Subject: [PATCH 2/2] SwiftOtter-SOP-348 Enable Compiled Configuration Cache for Test execution (workaround unfortunate escaping) --- .../framework/Magento/TestFramework/Application.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/dev/tests/integration/framework/Magento/TestFramework/Application.php b/dev/tests/integration/framework/Magento/TestFramework/Application.php index 2730ae11c1663..9ee80f3a57cd6 100644 --- a/dev/tests/integration/framework/Magento/TestFramework/Application.php +++ b/dev/tests/integration/framework/Magento/TestFramework/Application.php @@ -3,6 +3,7 @@ * Copyright 2018 Adobe * All Rights Reserved. */ + namespace Magento\TestFramework; use Magento\Framework\App\DeploymentConfig; @@ -366,7 +367,7 @@ private function initLogger() 'filePath' => $this->installDir ] ), - 'debug' => $objectManager->create( + 'debug' => $objectManager->create( \Magento\Framework\Logger\Handler\Debug::class, ['filePath' => $this->installDir] ), @@ -578,9 +579,12 @@ public function install($cleanup) PHP_BINARY . ' -f %s cache:disable -vvv --bootstrap=%s', [BP . '/bin/magento', $initParamsQuery] ); + + $enabledCaches = $this->getEnabledCaches(); + $this->_shell->execute( - PHP_BINARY . ' -f %s cache:enable -vvv %s --bootstrap=%s', - [BP . '/bin/magento', implode(' ', $this->getEnabledCaches()), $initParamsQuery, ] + PHP_BINARY . ' -f %s cache:enable -vvv ' . str_repeat('%s ', count($enabledCaches)) . ' --bootstrap=%s', + [BP . '/bin/magento', ...$enabledCaches, $initParamsQuery] ); // right after a clean installation, store DB dump for future reuse in tests or running the test suite again @@ -590,7 +594,7 @@ public function install($cleanup) } /** - * Returns caches that should be enabled during the Integration Tests execution + * Caches that should be enabled during the Integration Tests execution * * @return array */