Skip to content

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

Merged
merged 14 commits into from
Sep 26, 2019

Conversation

jilu1
Copy link
Contributor

@jilu1 jilu1 commented Sep 5, 2019

Description

Fixed Issues (if relevant)

  1. magento/magento2-functional-testing-framework#<issue_number>: Issue title
  2. ...

Contribution checklist

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/verification tests (if applicable)
  • All automated tests passed successfully (all builds on Travis CI are green)
  • Changes to Framework doesn't have backward incompatible changes for tests or have related Pull Request with fixes to tests

@coveralls
Copy link

coveralls commented Sep 9, 2019

Coverage Status

Coverage increased (+0.9%) to 53.721% when pulling 83c3fbd on MQE-1650-2 into 17082a1 on develop.

@okolesnyk okolesnyk self-requested a review September 16, 2019 12:29
@@ -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
Copy link
Member

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 ?

Copy link
Contributor Author

@jilu1 jilu1 Sep 19, 2019

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

Copy link
Contributor

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.

Copy link
Contributor Author

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.

Copy link
Contributor

@KevinBKozan KevinBKozan left a 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

Copy link
Contributor

@KevinBKozan KevinBKozan left a 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!

*/
private function extractKeyByPath($path)
{
if (empty($path)) {
Copy link
Contributor

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 '';

Copy link
Contributor Author

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 . ">[^\/]+)\/.+~";
Copy link
Contributor

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?

Copy link
Contributor Author

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

Copy link
Contributor

@KevinBKozan KevinBKozan left a 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.

KevinBKozan
KevinBKozan previously approved these changes Sep 26, 2019
Copy link
Contributor

@KevinBKozan KevinBKozan left a 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 👍

@jilu1 jilu1 merged commit 53e33f6 into develop Sep 26, 2019
@jilu1 jilu1 deleted the MQE-1650-2 branch February 6, 2020 16:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants