magento / magento2-functional-testing-framework

Magento2 Functional Testing Framework
Other
155 stars 133 forks source link

33294 eliminate aspectmock from allureHelperTest #839

Closed SilinMykola closed 3 years ago

SilinMykola commented 3 years ago

Description

Eliminate AspectMock usage from dev/tests/unit/Magento/FunctionalTestFramework/Allure/AllureHelperTest.php

Fixed Issues

  1. magento/magento2#33294: [MFTF] Eliminate AspectMock from AllureHelperTest (Complex!) #33294

Contribution checklist

jilu1 commented 3 years ago

@magento import pull request to https://github.com/magento-commerce/magento2-functional-testing-framework

jilu1 commented 3 years ago

@SilinMykola Thank you for your pull request! We will review and update you soon.

jilu1 commented 3 years ago

@magento import pull request to https://github.com/magento-commerce/magento2-functional-testing-framework

jilu1 commented 3 years ago

@SilinMykola Please fix the 3 unit test failures in this PR?

sivaschenko commented 3 years ago

@SilinMykola thanks for the pull request! Would you be able to respond to the code review comments?

SilinMykola commented 3 years ago

@sivaschenko hi! Yes, I'll try to fix all tests errors. I need some time for this.

bohdan-harniuk commented 3 years ago

Hello, @jilu1

I have a little bit helped for @SilinMykola with the aspect mock replacement here. Please, proceed with the code review.

cc: @SilinMykola, @sivaschenko

jilu1 commented 3 years ago

@magento import pull request to https://github.com/magento-commerce/magento2-functional-testing-framework

magento-engcom-team commented 3 years ago

@jilu1 the pull request successfully imported.

bohdan-harniuk commented 3 years ago

@bohdan-harniuk Have you run this PR with magento platform-health branch? I have seen the following exception when running a build:

[group329] PHP Fatal error:  Uncaught TypeError: file_exists() expects parameter 1 to be a valid path, object given in /var/www/html/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Allure/Event/AddUniqueAttachmentEvent.php:34
[group329] Stack trace:
[group329] #0 /var/www/html/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Allure/Event/AddUniqueAttachmentEvent.php(34): file_exists()
[group329] #1 /var/www/html/vendor/allure-framework/allure-php-api/src/Yandex/Allure/Adapter/Event/AddAttachmentEvent.php(34): Magento\FunctionalTestingFramework\Allure\Event\AddUniqueAttachmentEvent->getAttachmentFileName()
[group329] #2 /var/www/html/vendor/allure-framework/allure-php-api/src/Yandex/Allure/Adapter/Allure.php(116): Yandex\Allure\Adapter\Event\AddAttachmentEvent->process()
[group329] #3 /var/www/html/vendor/allure-framework/allure-php-api/src/Yandex/Allure/Adapter/Allure.php(92): Yandex\Allure\Adapter\Allure->processStepEvent()
[group329] #4 /var/www/html/vendor/magento/magento2-functional-testing-framework/src/Magento/ in /var/www/html/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Allure/Event/AddUniqueAttachmentEvent.php on line 34

This exception happened in multiple test groups.

Hello, @jilu1! No, I haven’t checked it because we didn't change any business logic here:

Screenshot 2021-07-30 at 17 39 32

Could you please take a look at it? What do you think, how it is possible that we broke something?

Thanks, Bohdan

jilu1 commented 3 years ago

@bohdan-harniuk Have you run this PR with magento platform-health branch? I have seen the following exception when running a build:

[group329] PHP Fatal error:  Uncaught TypeError: file_exists() expects parameter 1 to be a valid path, object given in /var/www/html/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Allure/Event/AddUniqueAttachmentEvent.php:34
[group329] Stack trace:
[group329] #0 /var/www/html/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Allure/Event/AddUniqueAttachmentEvent.php(34): file_exists()
[group329] #1 /var/www/html/vendor/allure-framework/allure-php-api/src/Yandex/Allure/Adapter/Event/AddAttachmentEvent.php(34): Magento\FunctionalTestingFramework\Allure\Event\AddUniqueAttachmentEvent->getAttachmentFileName()
[group329] #2 /var/www/html/vendor/allure-framework/allure-php-api/src/Yandex/Allure/Adapter/Allure.php(116): Yandex\Allure\Adapter\Event\AddAttachmentEvent->process()
[group329] #3 /var/www/html/vendor/allure-framework/allure-php-api/src/Yandex/Allure/Adapter/Allure.php(92): Yandex\Allure\Adapter\Allure->processStepEvent()
[group329] #4 /var/www/html/vendor/magento/magento2-functional-testing-framework/src/Magento/ in /var/www/html/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Allure/Event/AddUniqueAttachmentEvent.php on line 34

This exception happened in multiple test groups.

Hello, @jilu1! No, I haven’t checked it because we didn't change any business logic here:

Screenshot 2021-07-30 at 17 39 32

Could you please take a look at it? What do you think, how it is possible that we broke something?

Thanks, Bohdan @bohdan-harniuk

I did not see anything obviously also but the failing build is observed when I run 5 PRs (#839, #843, #844, #845, #852) in a batch. Please double-check from your side. I will look into it more.

jilu1 commented 3 years ago

@SilinMykola @bohdan-harniuk

FYI: The exception is reproducible running this PR branch alone.

karyna-tsymbal-atwix commented 3 years ago

Hi @jilu1 , I've just re-checked our PR. It seems that after the branch was actualized the problem that you described is gone. I don't see any errors on my local environment. Can you please check it one more time?

jilu1 commented 3 years ago

Hi @jilu1 , I've just re-checked our PR. It seems that after the branch was actualized the problem that you described is gone. I don't see any errors on my local environment. Can you please check it one more time?

@karyna-tsymbal-atwix Have you run this PR with Magento platform-health branch? To reproduce it, you can create a Magento PR based on platform-health and use mftf from this PR. You should see the problem when running the full CE/EE/B2B build. It happens in some test groups but not all of them.

bohdan-harniuk commented 3 years ago

Hello, @jilu1 !

I've reproduced mentioned error! I'll fix it!

Thank you!

bohdan-harniuk commented 3 years ago

I've successfully reproduced mentioned issue:

Screenshot 2021-08-09 at 17 50 29

My steps to reproduce:

  1. Run any MFTF test without running WebDriver (ChromeDriver)
  2. Got this error

After fixing this issue I got the correct output:

Screenshot 2021-08-09 at 18 12 41

And successfully finished test:

Screenshot 2021-08-09 at 18 09 40

@jilu1, could you please recheck if everything is fine?

Thank you, Bohdan.

jilu1 commented 3 years ago

@magento import pull request to https://github.com/magento-commerce/magento2-functional-testing-framework

magento-engcom-team commented 3 years ago

@jilu1 the pull request successfully imported.