-
Notifications
You must be signed in to change notification settings - Fork 132
Mqe 1650 Update MFTF configuration to read Test entities from new location #445
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…cation - fix static md errors
@@ -43,7 +43,7 @@ BROWSER=chrome | |||
#DEFAULT_TIMEZONE=America/Los_Angeles | |||
|
|||
#*** These properties impact the modules loaded into MFTF, you can point to your own full path, or a custom set of modules located with the core set | |||
MODULE_WHITELIST=Magento_Framework,Magento_ConfigurableProductWishlist,Magento_ConfigurableProductCatalogSearch | |||
MODULE_WHITELIST=Magento_Framework,ConfigurableProductWishlist,ConfigurableProductCatalogSearch |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did you removed Magento_
from module name ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are plain white list module paths. They should not be assumed to be magento module to match based on current logic
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From my reviewing it seems Magento_Module
format is still usable for .env
since it merges to an existing list of Magento_Module
formatted modules.
@jilu1 do either format work based on your implementation? I think the biggest concern here is backward compatibility.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Before the change, these modules are not found by the ModuleResolver because they did not follow the search pattern.
After change, we search this path specifically. And they are in white list so it will be included.
src/Magento/FunctionalTestingFramework/Test/Util/TestObjectExtractor.php
Outdated
Show resolved
Hide resolved
…cation - improvement in ComposerJsonFinder
src/Magento/FunctionalTestingFramework/Util/ComposerModuleResolver.php
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Accidentally approved in above
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Gave up on different approach, focused on trimming unecessary aspect of current approach. Please let me know if you need any clarification!
src/Magento/FunctionalTestingFramework/Composer/Handlers/ComposerPackager.php
Outdated
Show resolved
Hide resolved
src/Magento/FunctionalTestingFramework/Composer/Handlers/ComposerPackager.php
Outdated
Show resolved
Hide resolved
src/Magento/FunctionalTestingFramework/Composer/Handlers/ComposerInstaller.php
Outdated
Show resolved
Hide resolved
src/Magento/FunctionalTestingFramework/Composer/Handlers/AbstractComposerHandler.php
Outdated
Show resolved
Hide resolved
src/Magento/FunctionalTestingFramework/Composer/Handlers/AbstractComposerHandler.php
Outdated
Show resolved
Hide resolved
*/ | ||
private function extractKeyByPath($path) | ||
{ | ||
if (empty($path)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function can be simplified:
$shortenedPath = dirname(dirname($path));
if (empty($path)) {
return '';
}
foreach ($this->testModulePaths as $key => $value) {
if ($value == $shortenedPath) {
return $key;
}
}
return '';
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Your code will need more checks as well. like what if depth of $path is shorter than 3. let's discuss in person
]; | ||
|
||
foreach ($dirPaths as $dirPath) { | ||
$regex = "~.+\\/" . $dirPath . "\/(?<" . self::VENDOR . ">[^\/]+)\/.+~"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small refactor for legibility:
$regex = '~/' . $dirPath . '/([^/]+)~';
// Escape directory separators
$regex = str_replace('/', '\/', $regex);
preg_match($regex, $path, $match);
if (isset($match[1])) {
$possibleVendorName = ucfirst($match[1]);
break;
}
What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's discuss in person
…cation - address reviews
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One small response about a conditional. Continuing on QAing it though.
…cation - address reviews
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No BIC changes detected, approved 👍
# Conflicts: # composer.lock
…cation - fix composer.lock merge conflict
Description
Fixed Issues (if relevant)
Contribution checklist