Skip to content

Commit 8aef976

Browse files
committed
MQE-2040: Unable to run suites from standalone MFTF
added additional path for standalone
1 parent 6232cb0 commit 8aef976

File tree

1 file changed

+12
-22
lines changed
  • src/Magento/FunctionalTestingFramework/Config/FileResolver

1 file changed

+12
-22
lines changed

src/Magento/FunctionalTestingFramework/Config/FileResolver/Root.php

+12-22
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
use Magento\FunctionalTestingFramework\Exceptions\TestFrameworkException;
1111
use Magento\FunctionalTestingFramework\Util\Iterator\File;
1212
use Magento\FunctionalTestingFramework\Util\Path\FilePathFormatter;
13-
use Magento\FunctionalTestingFramework\Config\MftfApplicationConfig;
1413

1514
class Root extends Mask
1615
{
@@ -29,10 +28,21 @@ public function get($filename, $scope)
2928
{
3029
// First pick up the root level test suite dir
3130
$paths = glob(
32-
FilePathFormatter::format($this->getRootSuiteDirPath()) . self::ROOT_SUITE_DIR
31+
FilePathFormatter::format(TESTS_BP) . self::ROOT_SUITE_DIR
3332
. DIRECTORY_SEPARATOR . '*.xml'
3433
);
3534

35+
// include root suite dir when running standalone version
36+
$altPath = MAGENTO_BP . DIRECTORY_SEPARATOR . 'dev/tests/acceptance';
37+
38+
if (realpath($altPath) && ($altPath !== TESTS_BP)) {
39+
$paths = array_merge($paths,
40+
glob(FilePathFormatter::format($altPath) . self::ROOT_SUITE_DIR
41+
. DIRECTORY_SEPARATOR . '*.xml'
42+
)
43+
);
44+
}
45+
3646
// Then merge this path into the module based paths
3747
// Since we are sharing this code with Module based resolution we will unnecessarily glob against modules in the
3848
// 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)
4252
$iterator = new File($paths);
4353
return $iterator;
4454
}
45-
46-
/**
47-
* Returns root suite directory _suite 's path
48-
*
49-
* @return string
50-
* @throws TestFrameworkException
51-
*/
52-
public function getRootSuiteDirPath()
53-
{
54-
if (FilePathFormatter::format(MAGENTO_BP, false)
55-
=== FilePathFormatter::format(FW_BP, false)) {
56-
return TESTS_BP;
57-
} else {
58-
if (MftfApplicationConfig::getConfig()->getPhase()
59-
!== MftfApplicationConfig::UNIT_TEST_PHASE) {
60-
return (MAGENTO_BP . DIRECTORY_SEPARATOR . 'dev/tests/acceptance');
61-
}
62-
return TESTS_BP;
63-
}
64-
}
6555
}

0 commit comments

Comments
 (0)