extdn / github-actions-m2

137 stars 46 forks source link

Unable to parse fixtures error on Magento 2.4.5 #73

Closed BorisovskiP closed 1 year ago

BorisovskiP commented 2 years ago

Running github action on Magento 2.4.5 fails and shows the following error:

Unable to parse fixtures
#0 /tmp/m2/local-source/__extdn_github-actions-m2_7/Test/Integration/Console/Command/Tax/Rates/EditCommandTest.php(52): CustomGento\CliTaxEditor\Test\Integration\Console\Command\Tax\Rates\EditCommandTest->testExecuteWithoutTitles()

Caused By: Call to undefined method ReflectionMethod::getAttributes()
#0 /tmp/m2/dev/tests/integration/framework/Magento/TestFramework/Annotation/Parser/Composite.php(47): Magento\TestFramework\Fixture\Parser\IndexerDimensionMode->parse(Object(CustomGento\CliTaxEditor\Test\Integration\Console\Command\Tax\Rates\EditCommandTest), 'method')
#1 /tmp/m2/dev/tests/integration/framework/Magento/TestFramework/Annotation/IndexerDimensionMode.php(165): Magento\TestFramework\Annotation\Parser\Composite->parse(Object(CustomGento\CliTaxEditor\Test\Integration\Console\Command\Tax\Rates\EditCommandTest), 'method')
#2 /tmp/m2/dev/tests/integration/framework/Magento/TestFramework/Annotation/IndexerDimensionMode.php(105): Magento\TestFramework\Annotation\IndexerDimensionMode->parse(Object(CustomGento\CliTaxEditor\Test\Integration\Console\Command\Tax\Rates\EditCommandTest))
#3 [internal function]: Magento\TestFramework\Annotation\IndexerDimensionMode->startTest(Object(CustomGento\CliTaxEditor\Test\Integration\Console\Command\Tax\Rates\EditCommandTest))
#4 /tmp/m2/dev/tests/integration/framework/Magento/TestFramework/EventManager.php(49): call_user_func_array(Array, Array)
#5 /tmp/m2/dev/tests/integration/framework/Magento/TestFramework/Event/PhpUnit.php(127): Magento\TestFramework\EventManager->fireEvent('startTest', Array)
#6 /tmp/m2/vendor/phpunit/phpunit/src/Framework/TestResult.php(438): Magento\TestFramework\Event\PhpUnit->startTest(Object(CustomGento\CliTaxEditor\Test\Integration\Console\Command\Tax\Rates\EditCommandTest))
#7 /tmp/m2/vendor/phpunit/phpunit/src/Framework/TestResult.php(661): PHPUnit\Framework\TestResult->startTest(Object(CustomGento\CliTaxEditor\Test\Integration\Console\Command\Tax\Rates\EditCommandTest))
#8 /tmp/m2/vendor/phpunit/phpunit/src/Framework/TestCase.php(903): PHPUnit\Framework\TestResult->run(Object(CustomGento\CliTaxEditor\Test\Integration\Console\Command\Tax\Rates\EditCommandTest))
#9 /tmp/m2/vendor/phpunit/phpunit/src/Framework/TestSuite.php(670): PHPUnit\Framework\TestCase->run(Object(PHPUnit\Framework\TestResult))
#10 /tmp/m2/vendor/phpunit/phpunit/src/Framework/TestSuite.php(670): PHPUnit\Framework\TestSuite->run(Object(PHPUnit\Framework\TestResult))
#11 /tmp/m2/vendor/phpunit/phpunit/src/Framework/TestSuite.php(670): PHPUnit\Framework\TestSuite->run(Object(PHPUnit\Framework\TestResult))
#12 /tmp/m2/vendor/phpunit/phpunit/src/TextUI/TestRunner.php(673): PHPUnit\Framework\TestSuite->run(Object(PHPUnit\Framework\TestResult))
#13 /tmp/m2/vendor/phpunit/phpunit/src/TextUI/Command.php(143): PHPUnit\TextUI\TestRunner->run(Object(PHPUnit\Framework\TestSuite), Array, Array, true)
#14 /tmp/m2/vendor/phpunit/phpunit/src/TextUI/Command.php(96): PHPUnit\TextUI\Command->run(Array, true)
#15 phpvfscomposer:///tmp/m2/vendor/phpunit/phpunit/phpunit(97): PHPUnit\TextUI\Command::main()
#16 /tmp/m2/vendor/bin/phpunit(118): include('phpvfscomposer:...')
#17 {main}

The whole log can be seen here: https://github.com/customgento/module-cli-tax-editor-m2/runs/7898194786?check_suite_focus=true

One thing i noticed is that the phpunit.xml file for the actions is a bit outdated compared to the phpunit.xml file in Magento 2.4.5

Strangely enough, the issue can't be reproduced locally (even when https://github.com/extdn/github-actions-m2/blob/master/magento-integration-tests/docker-files/phpunit.xml is added to the local instance)

jissereitsma commented 2 years ago

If I'm googling for this, then I see that the call ReflectionMethod::getAttributes() is only available under PHP 8: https://www.php.net/manual/en/reflectionfunctionabstract.getattributes.php Which PHP version are you using?

sprankhub commented 2 years ago

Good catch, @jissereitsma! Looking at https://github.com/customgento/module-cli-tax-editor-m2/runs/7898194786?check_suite_focus=true, this happens on 2.4.5 with PHP 7.4. So I fear Magento 2.4.5 is not completely compatible with PHP 7.4 :sob:

jissereitsma commented 1 year ago

As of yet, this issue seems more a fart from Magento (as in: Magento 2.4.5 not supporting PHP 7.4) instead of the GitHub Actions. Because of this, I'm going to close this issue. Forgive me.