From 86fe855f1c44f581141e4c6e1117654efdcfba4c Mon Sep 17 00:00:00 2001 From: KevinBKozan Date: Wed, 18 Jul 2018 16:18:26 -0500 Subject: [PATCH 1/2] MQE-1147: make mftf.log visible on server - added to build:project command. --- .../Console/BuildProjectCommand.php | 8 ++++++++ .../Util/Logger/LoggingUtil.php | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/Magento/FunctionalTestingFramework/Console/BuildProjectCommand.php b/src/Magento/FunctionalTestingFramework/Console/BuildProjectCommand.php index c5b48ba83..ca82a552d 100644 --- a/src/Magento/FunctionalTestingFramework/Console/BuildProjectCommand.php +++ b/src/Magento/FunctionalTestingFramework/Console/BuildProjectCommand.php @@ -7,6 +7,8 @@ namespace Magento\FunctionalTestingFramework\Console; +use Magento\FunctionalTestingFramework\Util\Logger\LoggingUtil; +use Magento\Invitation\Model\Logging; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\ArrayInput; use Symfony\Component\Filesystem\Filesystem; @@ -147,6 +149,12 @@ private function generateConfigFiles(OutputInterface $output) self::CREDENTIALS_FILE_PATH ); + // Remove and Create Log File + $logPath = LoggingUtil::getInstance()->getLoggingPath(); + $fileSystem->remove($logPath); + $fileSystem->touch($logPath); + $fileSystem->chmod($logPath, 0777); + $output->writeln('.credentials.example successfully applied.'); } } diff --git a/src/Magento/FunctionalTestingFramework/Util/Logger/LoggingUtil.php b/src/Magento/FunctionalTestingFramework/Util/Logger/LoggingUtil.php index 536a4a698..78b0c29ef 100644 --- a/src/Magento/FunctionalTestingFramework/Util/Logger/LoggingUtil.php +++ b/src/Magento/FunctionalTestingFramework/Util/Logger/LoggingUtil.php @@ -75,7 +75,7 @@ public function getLogger($clazz) * * @return string */ - private function getLoggingPath() + public function getLoggingPath() { return TESTS_BP . DIRECTORY_SEPARATOR . "mftf.log"; } From ae87f16fa01e6d2965801575f83c6bf9ad57f1f6 Mon Sep 17 00:00:00 2001 From: KevinBKozan Date: Thu, 19 Jul 2018 08:36:23 -0500 Subject: [PATCH 2/2] MQE-1147: make mftf.log visible on server - static check fixes --- .../Console/BuildProjectCommand.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Magento/FunctionalTestingFramework/Console/BuildProjectCommand.php b/src/Magento/FunctionalTestingFramework/Console/BuildProjectCommand.php index ca82a552d..350a004f3 100644 --- a/src/Magento/FunctionalTestingFramework/Console/BuildProjectCommand.php +++ b/src/Magento/FunctionalTestingFramework/Console/BuildProjectCommand.php @@ -8,7 +8,6 @@ namespace Magento\FunctionalTestingFramework\Console; use Magento\FunctionalTestingFramework\Util\Logger\LoggingUtil; -use Magento\Invitation\Model\Logging; use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Input\ArrayInput; use Symfony\Component\Filesystem\Filesystem; @@ -19,6 +18,12 @@ use Magento\FunctionalTestingFramework\Util\Env\EnvProcessor; use Symfony\Component\Yaml\Yaml; +/** + * Class BuildProjectCommand + * @package Magento\FunctionalTestingFramework\Console + * + * @SuppressWarnings(PHPMD.CouplingBetweenObjects) + */ class BuildProjectCommand extends Command { const DEFAULT_YAML_INLINE_DEPTH = 10;