magento / magento2-functional-testing-framework

Magento2 Functional Testing Framework
Other
155 stars 131 forks source link

Upgrading Magento 2 functional testing framework above 4.2.1 breaks test because of Namespace Changes in allure-framework #912

Open JesperHerrloff opened 11 months ago

JesperHerrloff commented 11 months ago

When trying to run tests in newer version than 4.2.1 it gets an exception that it cant find AllureCodeception class.

Referenced here with Namespace Yandex\Allure https://github.com/magento/magento2-functional-testing-framework/blob/develop/src/Magento/FunctionalTestingFramework/Allure/Adapter/MagentoAllureAdapter.php#L20

And in composer.lock Namespace Qameta\Allure\Codeception https://github.com/magento/magento2-functional-testing-framework/blob/develop/composer.lock#L39

Which is references to allure-phpcommons Yandex\Allure Namespace https://github.com/magento/magento2-functional-testing-framework/blob/develop/composer.lock#L111

But if we check The repo at allure-codeception The AllureCodeception is now declared Final class https://github.com/allure-framework/allure-codeception/blob/main/src/AllureCodeception.php#L38

Preconditions

Not Relevant

Steps to reproduce

Update Magento2 Functional Testing Framework above 4.2.1 Then it updates the dependency to allure-framework/allure-codeception which breaks because of namespace changes.

Expected result

Test to be executed

Actual result

Because of Namespace changes in allure-codeception an exception is thrown when MagentoAllureAdapter extending not existing class.

If you lock the testing framework to version 4.2.1 and not ^4.2.1 and run composer update everything works again.

m2-assistant[bot] commented 11 months ago

Hi @JesperHerrloff. Thank you for your report. To speed up processing of this issue, make sure that you provided sufficient information. Add a comment to assign the issue: @magento I am working on this


Join Magento Community Engineering Slack and ask your questions in #github channel.

JesperHerrloff commented 11 months ago

Found the reason on Why it happens. When you update the Testing Framework, the codeception.yml and functional.suite.yml doesnt get updated if you dont remove them.

Maybe there should be a form of warning/error message when you run mftf build:project if the files cant be updated.