Skip to content

Commit ca9ab11

Browse files
committed
MQE-1650: Update MFTF configuration to read Test entities from new location
1 parent 97fe09b commit ca9ab11

File tree

2 files changed

+6
-30
lines changed

2 files changed

+6
-30
lines changed

src/Magento/FunctionalTestingFramework/Composer/Handlers/AbstractComposerHandler.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,10 @@ protected function parseSuggestsForMagentoModuleNames($suggests)
113113
$parts = explode(',', $suggest);
114114
$data = [];
115115
foreach ($parts as $part) {
116-
list($name, $value) = explode(':', $part, 2);
117-
$data[strtolower(trim($name))] = trim($value);
116+
if (strpos($part, ':') !== false) {
117+
list($name, $value) = explode(':', $part, 2);
118+
$data[strtolower(trim($name))] = trim($value);
119+
}
118120
}
119121

120122
if (isset($data[self::SUGGEST_TYPE])

src/Magento/FunctionalTestingFramework/Util/ModuleResolver.php

Lines changed: 2 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -275,13 +275,12 @@ public function getModulesPath($flat = true)
275275
$allModulePaths = $this->normalizeModuleNames($allModulePaths);
276276

277277
if (MftfApplicationConfig::getConfig()->forceGenerateEnabled()) {
278-
$allModulePaths = $this->flipAndFlattenArray($allModulePaths);
278+
$allModulePaths = $this->flipAndFilterArray($allModulePaths);
279279
$this->enabledModulePaths = $this->applyCustomModuleMethods($allModulePaths);
280280
return $this->enabledModulePaths;
281281
}
282282

283283
$enabledModules = array_merge($this->getEnabledModules(), $this->getModuleWhitelist());
284-
//$enabledDirectoryPaths = $this->getEnabledDirectoryPaths($enabledModules, $allModulePaths);
285284
$enabledDirectoryPaths = $this->flipAndFilterArray($allModulePaths, $enabledModules);
286285

287286
$this->enabledModulePaths = $this->applyCustomModuleMethods($enabledDirectoryPaths);
@@ -425,7 +424,7 @@ private function globRelevantPaths($testPath, $pattern)
425424
&& !empty($modulePaths)
426425
) {
427426
$deprecatedPath = self::DEPRECATED_DEV_TESTS;
428-
$suggestedPath = self::DEV_TESTS . DIRECTORY_SEPARATOR . 'Vendor';
427+
$suggestedPath = self::DEV_TESTS . DIRECTORY_SEPARATOR . 'Magento';
429428
LoggingUtil::getInstance()->getLogger(ModuleResolver::class)->warning(
430429
"DEPRECATION: $deprecatedPath is deprecated! Please move mftf test modules to $suggestedPath"
431430
);
@@ -600,31 +599,6 @@ private function flattenAllModulePaths($modulePaths)
600599
return $resultArray;
601600
}
602601

603-
/**
604-
* Runs through enabled modules and maps them known module paths by name.
605-
* @param array $enabledModules
606-
* @param array $allModulePaths
607-
* @return array
608-
*/
609-
private function getEnabledDirectoryPaths($enabledModules, $allModulePaths)
610-
{
611-
$enabledDirectoryPaths = [];
612-
foreach ($enabledModules as $magentoModuleName) {
613-
if (!isset($this->knownDirectories[$magentoModuleName]) && !isset($allModulePaths[$magentoModuleName])) {
614-
continue;
615-
} elseif (isset($this->knownDirectories[$magentoModuleName])
616-
&& !isset($allModulePaths[$magentoModuleName])) {
617-
LoggingUtil::getInstance()->getLogger(ModuleResolver::class)->warn(
618-
"Known directory could not match to an existing path.",
619-
['knownDirectory' => $magentoModuleName]
620-
);
621-
} else {
622-
$enabledDirectoryPaths[$magentoModuleName] = $allModulePaths[$magentoModuleName];
623-
}
624-
}
625-
return $enabledDirectoryPaths;
626-
}
627-
628602
/**
629603
* Executes a REST call to the supplied Magento Base Url for version information to display during generation
630604
*

0 commit comments

Comments
 (0)