Skip to content
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

[MFTF] Eliminate AspectMock from AllureHelperTest (Complex!) #33294

Closed
sivaschenko opened this issue Jun 20, 2021 · 5 comments
Closed

[MFTF] Eliminate AspectMock from AllureHelperTest (Complex!) #33294

sivaschenko opened this issue Jun 20, 2021 · 5 comments
Assignees
Labels
Priority: P1 Once P0 defects have been fixed, a defect having this priority is the next candidate for fixing. Progress: done Project: Platform Health

Comments

@sivaschenko
Copy link
Member

This task is tricky and requires investigation on the approach to mock static calls without Aspect Mock

Goal

codeception/aspect-mock library is still not compatible with PHP 8.0 at the time of the creation of this ticket.

To speed up Magento compatibility with new PHP versions we'd like to eliminate codeception/aspect-mock dependency from MFTF. This will make MFTF compatible with PHP 8.0 that is required for declaring the Magento core PHP 8 compatible as well.

In order to do this existing unit tests using AspectMock should be refactored to use PHPUnit instead.

Task

Eliminate AspectMock usage from dev/tests/unit/Magento/FunctionalTestFramework/Allure/AllureHelperTest.php in https://github.com/magento/magento2-functional-testing-framework repository.

Example

Mocking an object using AspectMock (current):

        $mock = AspectMock::double(
            MockedClass::class,
            [
                'mockedMethodName' => 'methodReturnValue',
            ]
        )->make();

Mocking an object using PHPUnit (refactored code):

        $mock = $this->createMock(File::class);
        $file->expects($this->any())
            ->method('mockedMethodName')
            ->willReturn('methodReturnValue');

Example pull request: magento/magento2-functional-testing-framework#833

@m2-assistant
Copy link

m2-assistant bot commented Jun 20, 2021

Hi @sivaschenko. Thank you for your report.
To help us process this issue please make sure that you provided the following information:

  • Summary of the issue
  • Information on your environment
  • Steps to reproduce
  • Expected and actual results

Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:

@magento give me 2.4-develop instance - upcoming 2.4.x release

For more details, please, review the Magento Contributor Assistant documentation.

Please, add a comment to assign the issue: @magento I am working on this


⚠️ According to the Magento Contribution requirements, all issues must go through the Community Contributions Triage process. Community Contributions Triage is a public meeting.

🕙 You can find the schedule on the Magento Community Calendar page.

📞 The triage of issues happens in the queue order. If you want to speed up the delivery of your contribution, please join the Community Contributions Triage session to discuss the appropriate ticket.

🎥 You can find the recording of the previous Community Contributions Triage on the Magento Youtube Channel

✏️ Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel

@m2-community-project m2-community-project bot added this to Ready for Development in Platform Health Backlog Jun 20, 2021
@sivaschenko sivaschenko added the Priority: P1 Once P0 defects have been fixed, a defect having this priority is the next candidate for fixing. label Jun 24, 2021
@SilinMykola
Copy link
Contributor

@magento I am working on this

@sivaschenko
Copy link
Member Author

@magento export issue to Jira project AC as Story

@github-jira-sync-bot
Copy link

✅ Jira issue https://jira.corp.magento.com/browse/AC-315 is successfully created for this GitHub issue.

@sivaschenko sivaschenko moved this from Dev In Progress to Pull Request In Progress in Platform Health Backlog Jul 14, 2021
@andrewbess
Copy link

PR has been merged to MFTF repo

@m2-community-project m2-community-project bot moved this from Pull Request In Progress to Done in Platform Health Backlog Aug 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority: P1 Once P0 defects have been fixed, a defect having this priority is the next candidate for fixing. Progress: done Project: Platform Health
Projects
No open projects
Development

No branches or pull requests

4 participants