diff --git a/dev/tests/integration/framework/Magento/TestFramework/Application.php b/dev/tests/integration/framework/Magento/TestFramework/Application.php index 9cec75e9c4500..9ee80f3a57cd6 100644 --- a/dev/tests/integration/framework/Magento/TestFramework/Application.php +++ b/dev/tests/integration/framework/Magento/TestFramework/Application.php @@ -1,8 +1,9 @@ $this->installDir ] ), - 'debug' => $objectManager->create( + 'debug' => $objectManager->create( \Magento\Framework\Logger\Handler\Debug::class, ['filePath' => $this->installDir] ), @@ -578,16 +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 %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 ' . 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 @@ -596,6 +593,22 @@ public function install($cleanup) } } + /** + * 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 *