From b418914410254e96fdf212823a1903875e3a9dc6 Mon Sep 17 00:00:00 2001 From: Soumya Unnikrishnan Date: Tue, 24 Mar 2020 11:33:56 -0500 Subject: [PATCH 1/6] MQE-2040: Unable to run suites from standalone MFTF Included suite php files to standalone_bootstrap --- dev/tests/functional/standalone_bootstrap.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/dev/tests/functional/standalone_bootstrap.php b/dev/tests/functional/standalone_bootstrap.php index 34516236e..b2bdd05d2 100755 --- a/dev/tests/functional/standalone_bootstrap.php +++ b/dev/tests/functional/standalone_bootstrap.php @@ -74,3 +74,9 @@ if (!(bool)$debug_mode && extension_loaded('xdebug')) { xdebug_disable(); } + +// include suite php files +$groupPath = PROJECT_ROOT . '/src/Magento/FunctionalTestingFramework/Group'; +foreach (glob($groupPath. '/*.php') as $suitePhpFile) { + include_once $suitePhpFile; +} From 265db9aa4e4d864844437b3292a710050f32e818 Mon Sep 17 00:00:00 2001 From: Soumya Unnikrishnan Date: Fri, 27 Mar 2020 16:45:27 -0500 Subject: [PATCH 2/6] MQE-2040: Unable to run suites from standalone MFTF Updated $ROOT_SUITE dir path based on installation type --- dev/tests/functional/standalone_bootstrap.php | 5 ----- .../FunctionalTestingFramework/Config/FileResolver/Root.php | 4 +++- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/dev/tests/functional/standalone_bootstrap.php b/dev/tests/functional/standalone_bootstrap.php index b2bdd05d2..ead745858 100755 --- a/dev/tests/functional/standalone_bootstrap.php +++ b/dev/tests/functional/standalone_bootstrap.php @@ -75,8 +75,3 @@ xdebug_disable(); } -// include suite php files -$groupPath = PROJECT_ROOT . '/src/Magento/FunctionalTestingFramework/Group'; -foreach (glob($groupPath. '/*.php') as $suitePhpFile) { - include_once $suitePhpFile; -} diff --git a/src/Magento/FunctionalTestingFramework/Config/FileResolver/Root.php b/src/Magento/FunctionalTestingFramework/Config/FileResolver/Root.php index 0ff6e4a77..d181b76f8 100644 --- a/src/Magento/FunctionalTestingFramework/Config/FileResolver/Root.php +++ b/src/Magento/FunctionalTestingFramework/Config/FileResolver/Root.php @@ -27,8 +27,10 @@ class Root extends Mask public function get($filename, $scope) { // First pick up the root level test suite dir + $rootSuitePath = defined('MAGENTO_BP') ? MAGENTO_BP . '/dev/tests/acceptance/' : TESTS_BP; + $paths = glob( - FilePathFormatter::format(TESTS_BP) . self::ROOT_SUITE_DIR + FilePathFormatter::format($rootSuitePath) . self::ROOT_SUITE_DIR . DIRECTORY_SEPARATOR . '*.xml' ); From 6c4ef08dc5befd58cc8d0705588fa080b27d6130 Mon Sep 17 00:00:00 2001 From: Soumya Unnikrishnan Date: Mon, 30 Mar 2020 16:49:32 -0500 Subject: [PATCH 3/6] MQE-2040: Unable to run suites from standalone MFTF added getRootSuiteDirPath --- dev/tests/functional/standalone_bootstrap.php | 1 - .../Config/FileResolver/Root.php | 26 ++++++++++++++++--- 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/dev/tests/functional/standalone_bootstrap.php b/dev/tests/functional/standalone_bootstrap.php index ead745858..34516236e 100755 --- a/dev/tests/functional/standalone_bootstrap.php +++ b/dev/tests/functional/standalone_bootstrap.php @@ -74,4 +74,3 @@ if (!(bool)$debug_mode && extension_loaded('xdebug')) { xdebug_disable(); } - diff --git a/src/Magento/FunctionalTestingFramework/Config/FileResolver/Root.php b/src/Magento/FunctionalTestingFramework/Config/FileResolver/Root.php index d181b76f8..10ab59de9 100644 --- a/src/Magento/FunctionalTestingFramework/Config/FileResolver/Root.php +++ b/src/Magento/FunctionalTestingFramework/Config/FileResolver/Root.php @@ -10,6 +10,7 @@ use Magento\FunctionalTestingFramework\Exceptions\TestFrameworkException; use Magento\FunctionalTestingFramework\Util\Iterator\File; use Magento\FunctionalTestingFramework\Util\Path\FilePathFormatter; +use Magento\FunctionalTestingFramework\Config\MftfApplicationConfig; class Root extends Mask { @@ -27,10 +28,8 @@ class Root extends Mask public function get($filename, $scope) { // First pick up the root level test suite dir - $rootSuitePath = defined('MAGENTO_BP') ? MAGENTO_BP . '/dev/tests/acceptance/' : TESTS_BP; - $paths = glob( - FilePathFormatter::format($rootSuitePath) . self::ROOT_SUITE_DIR + FilePathFormatter::format($this->getRootSuiteDirPath()) . self::ROOT_SUITE_DIR . DIRECTORY_SEPARATOR . '*.xml' ); @@ -43,4 +42,25 @@ public function get($filename, $scope) $iterator = new File($paths); return $iterator; } + + /** + * Returns root suite directory _suite 's path + * + * @return string + * @throws TestFrameworkException + */ + public function getRootSuiteDirPath() + { + if (FilePathFormatter::format(MAGENTO_BP, false) + === FilePathFormatter::format(FW_BP, false)) { + return TESTS_BP; + } + else { + if (MftfApplicationConfig::getConfig()->getPhase() + !== MftfApplicationConfig::UNIT_TEST_PHASE) { + return (MAGENTO_BP . DIRECTORY_SEPARATOR . 'dev/tests/acceptance'); + } + return TESTS_BP; + } + } } From 6232cb0692732bb0b7a9bf4db795784ba5c3d3a3 Mon Sep 17 00:00:00 2001 From: Soumya Unnikrishnan Date: Mon, 30 Mar 2020 17:01:23 -0500 Subject: [PATCH 4/6] MQE-2040: Unable to run suites from standalone MFTF fixed static check --- .../FunctionalTestingFramework/Config/FileResolver/Root.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/Magento/FunctionalTestingFramework/Config/FileResolver/Root.php b/src/Magento/FunctionalTestingFramework/Config/FileResolver/Root.php index 10ab59de9..46945411f 100644 --- a/src/Magento/FunctionalTestingFramework/Config/FileResolver/Root.php +++ b/src/Magento/FunctionalTestingFramework/Config/FileResolver/Root.php @@ -54,8 +54,7 @@ public function getRootSuiteDirPath() if (FilePathFormatter::format(MAGENTO_BP, false) === FilePathFormatter::format(FW_BP, false)) { return TESTS_BP; - } - else { + } else { if (MftfApplicationConfig::getConfig()->getPhase() !== MftfApplicationConfig::UNIT_TEST_PHASE) { return (MAGENTO_BP . DIRECTORY_SEPARATOR . 'dev/tests/acceptance'); From 8aef976257290771453faff9245cc6add7c7ecb1 Mon Sep 17 00:00:00 2001 From: Soumya Unnikrishnan Date: Tue, 31 Mar 2020 13:13:43 -0500 Subject: [PATCH 5/6] MQE-2040: Unable to run suites from standalone MFTF added additional path for standalone --- .../Config/FileResolver/Root.php | 34 +++++++------------ 1 file changed, 12 insertions(+), 22 deletions(-) diff --git a/src/Magento/FunctionalTestingFramework/Config/FileResolver/Root.php b/src/Magento/FunctionalTestingFramework/Config/FileResolver/Root.php index 46945411f..59179181d 100644 --- a/src/Magento/FunctionalTestingFramework/Config/FileResolver/Root.php +++ b/src/Magento/FunctionalTestingFramework/Config/FileResolver/Root.php @@ -10,7 +10,6 @@ use Magento\FunctionalTestingFramework\Exceptions\TestFrameworkException; use Magento\FunctionalTestingFramework\Util\Iterator\File; use Magento\FunctionalTestingFramework\Util\Path\FilePathFormatter; -use Magento\FunctionalTestingFramework\Config\MftfApplicationConfig; class Root extends Mask { @@ -29,10 +28,21 @@ public function get($filename, $scope) { // First pick up the root level test suite dir $paths = glob( - FilePathFormatter::format($this->getRootSuiteDirPath()) . self::ROOT_SUITE_DIR + FilePathFormatter::format(TESTS_BP) . self::ROOT_SUITE_DIR . DIRECTORY_SEPARATOR . '*.xml' ); + // include root suite dir when running standalone version + $altPath = MAGENTO_BP . DIRECTORY_SEPARATOR . 'dev/tests/acceptance'; + + if (realpath($altPath) && ($altPath !== TESTS_BP)) { + $paths = array_merge($paths, + glob(FilePathFormatter::format($altPath) . self::ROOT_SUITE_DIR + . DIRECTORY_SEPARATOR . '*.xml' + ) + ); + } + // Then merge this path into the module based paths // Since we are sharing this code with Module based resolution we will unnecessarily glob against modules in the // dev/tests dir tree, however as we plan to migrate to app/code this will be a temporary unneeded check. @@ -42,24 +52,4 @@ public function get($filename, $scope) $iterator = new File($paths); return $iterator; } - - /** - * Returns root suite directory _suite 's path - * - * @return string - * @throws TestFrameworkException - */ - public function getRootSuiteDirPath() - { - if (FilePathFormatter::format(MAGENTO_BP, false) - === FilePathFormatter::format(FW_BP, false)) { - return TESTS_BP; - } else { - if (MftfApplicationConfig::getConfig()->getPhase() - !== MftfApplicationConfig::UNIT_TEST_PHASE) { - return (MAGENTO_BP . DIRECTORY_SEPARATOR . 'dev/tests/acceptance'); - } - return TESTS_BP; - } - } } From aa9de30c4f8f2b492f1e3cd5c04e8056da25b756 Mon Sep 17 00:00:00 2001 From: Soumya Unnikrishnan Date: Tue, 31 Mar 2020 13:30:17 -0500 Subject: [PATCH 6/6] MQE-2040: Unable to run suites from standalone MFTF fixed static checks --- .../Config/FileResolver/Root.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/Magento/FunctionalTestingFramework/Config/FileResolver/Root.php b/src/Magento/FunctionalTestingFramework/Config/FileResolver/Root.php index 59179181d..8593aaf47 100644 --- a/src/Magento/FunctionalTestingFramework/Config/FileResolver/Root.php +++ b/src/Magento/FunctionalTestingFramework/Config/FileResolver/Root.php @@ -36,11 +36,13 @@ public function get($filename, $scope) $altPath = MAGENTO_BP . DIRECTORY_SEPARATOR . 'dev/tests/acceptance'; if (realpath($altPath) && ($altPath !== TESTS_BP)) { - $paths = array_merge($paths, - glob(FilePathFormatter::format($altPath) . self::ROOT_SUITE_DIR - . DIRECTORY_SEPARATOR . '*.xml' - ) - ); + $paths = array_merge( + $paths, + glob( + FilePathFormatter::format($altPath) . self::ROOT_SUITE_DIR + . DIRECTORY_SEPARATOR . '*.xml' + ) + ); } // Then merge this path into the module based paths