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

Unable to parse fixtures error on Magento 2.4.5 #73

Closed
BorisovskiP opened this issue Aug 18, 2022 · 3 comments
Closed

Unable to parse fixtures error on Magento 2.4.5 #73

BorisovskiP opened this issue Aug 18, 2022 · 3 comments

Comments

@BorisovskiP
Copy link
Contributor

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
Copy link
Contributor

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
Copy link
Collaborator

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 😭

@jissereitsma
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants