magento2-functional-testing-framework icon indicating copy to clipboard operation
magento2-functional-testing-framework copied to clipboard

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

Open JesperHerrloff opened this issue 1 year ago • 2 comments

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.

JesperHerrloff avatar Dec 19 '23 08:12 JesperHerrloff

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.

m2-assistant[bot] avatar Dec 19 '23 08:12 m2-assistant[bot]

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.

JesperHerrloff avatar Dec 19 '23 19:12 JesperHerrloff