-
Notifications
You must be signed in to change notification settings - Fork 131
MQE-1124: [Github Issue] Allow running tests for modules installed in… #228
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
… Magento instance via vendor directory. #162 - Adjusted Module Resolver to look Recursively from Project Root, Magento BP and dev/tests - Updated Module Resolver Unit Tests to reflect changes
… Magento instance via vendor directory. #162 - Reintroduced recursive_merge to prevent similar directories with different contents being missed
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.
Changes to a great job of finding the paths, but there are matching problems (I'm sure you know about this from in person conversation though).
foreach (glob($testPath . $subDirectory, GLOB_ONLYDIR) as $dir) { | ||
$directories = array_merge_recursive($directories, self::globRelevantWrapper($dir, $pattern)); | ||
} | ||
return $directories; |
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 directory changes seem to pick up modules under vendor just fine, but consider the following:
I have pulled CE 2.2.6 and attempted to generate tests, the following path is directory is found by this glob:
/Users/kkozan/Documents/TestPull/magento2ce/vendor/magento/module-catalog/Test/Mftf
The function GlobRelevantPaths
assigns the above path to an index based on the module it found (which is found via the pattern given, leaving the path under module-catalog
.
This is going to fail to map to the module returned by our ping to Magento, Magento_Catalog
.
We need to find a way to map module-*
to Magento_*
manually or hopefully from the magento instance itself.
… Magento instance via vendor directory. - Updated to include checking through registered Magento modules
… Magento instance via vendor directory. - Used class constant instead of just adding it
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.
Feedback from in-person testing.
@@ -265,7 +270,8 @@ private function globRelevantPaths($testPath, $pattern) | |||
} | |||
|
|||
foreach ($relevantPaths as $codePath) { | |||
$mainModName = basename(str_replace($pattern, '', $codePath)); | |||
$allComponents = $this->getRegisteredModuleList(); |
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.
Need to do two things here:
- Strip
/Test/Mftf
off end of codepath - Assign to $modulePaths according to $allComponents value match (Magento_Store -> Store) to match module list
/** | ||
* List of path types present in Magento Component Registrar | ||
*/ | ||
const PATHS = ['module', 'library', 'theme', 'language', 'setup']; |
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.
Need to remove setup
from PATHS.
/** | ||
* Magento Registrar Class | ||
*/ | ||
const REGISTRAR_CLASS = "\Magento\Framework\Component\Registrar"; |
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.
Class should be \Magento\Framework\Component\ComponentRegistrar
… Magento instance via vendor directory. - Adding requested changes
… Magento instance via vendor directory. - Specified additional error in case of bad Magento basepath
@aljcalandra I'm going to triple check the last bit of changes against a git-pull installation of Magento, I'll let you know the results. |
@aljcalandra tested against git-pull Magento, double checked parsed test counts before/after. We are good to go here! |
Resolved /issues/162 |
… Magento instance via vendor directory. #162
Adjusted ModuleResolver to do a recursive search in directories related to PROJECT_ROOT and MAGENTO_BP
Fixed Issues (if relevant)
Contribution checklist