Skip to content

PHP Fatal error: MftfApplicationConfig not found in GenerateSuiteCommand #471

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

Closed
magicsunday opened this issue Sep 27, 2019 · 3 comments
Closed

Comments

@magicsunday
Copy link

magicsunday commented Sep 27, 2019

MFTF fails with fatal error due missing "use" statement

PHP Fatal error: Uncaught Error: Class 'Magento\FunctionalTestingFramework\Console\MftfApplicationConfig' not found in /var/www/html/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Console/GenerateSuiteCommand.php:52

Preconditions

Steps to reproduce

  1. Use latest tag (2.5.0)

Expected result

  1. MFTF tests to run

Actual result

PHP Fatal error: Uncaught Error: Class 'Magento\FunctionalTestingFramework\Console\MftfApplicationConfig' not found in /var/www/html/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Console/GenerateSuiteCommand.php:52
Stack trace:
#0 /var/www/html/vendor/symfony/console/Command/Command.php(255): Magento\FunctionalTestingFramework\Console\GenerateSuiteCommand->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#1 /var/www/html/vendor/symfony/console/Application.php(893): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#2 /var/www/html/vendor/symfony/console/Application.php(262): Symfony\Component\Console\Application->doRunCommand(Object(Magento\FunctionalTestingFramework\Console\GenerateSuiteCommand), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#3 /var/www in /var/www/html/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Console/GenerateSuiteCommand.php on line 52

@tomreece
Copy link
Contributor

tomreece commented Oct 9, 2019

I was able to reproduce this issue:

git checkout 2.5.0
mftf generate:suite PaypalTestSuite

Actual behavior:

PHP Fatal error:  Uncaught Error: Class 'Magento\FunctionalTestingFramework\Console\MftfApplicationConfig' not found in /Users/treece/dev/mftf/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Console/GenerateSuiteCommand.php:52
Stack trace:
#0 /Users/treece/dev/mftf/magento2-functional-testing-framework/vendor/symfony/console/Command/Command.php(255): Magento\FunctionalTestingFramework\Console\GenerateSuiteCommand->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#1 /Users/treece/dev/mftf/magento2-functional-testing-framework/vendor/symfony/console/Application.php(946): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#2 /Users/treece/dev/mftf/magento2-functional-testing-framework/vendor/symfony/console/Application.php(248): Symfony\Component\Console\Application->doRunCommand(Object(Magento\FunctionalTestingFramework\Console\Genera in /Users/treece/dev/mftf/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Console/GenerateSuiteCommand.php on line 52

Root cause:
GenerateSuiteCommand.php is missing:

use Magento\FunctionalTestingFramework\Config\MftfApplicationConfig;

Notes:
This is fixed in the develop branch already.

@tomreece
Copy link
Contributor

tomreece commented Oct 9, 2019

Workarounds:

  1. Add use Magento\FunctionalTestingFramework\Config\MftfApplicationConfig; to the GenerateSuiteCommand.php file
  2. Use generate:tests instead and then manually delete everything in the generated folder EXCEPT for the suite folder you want to run.

@tomreece
Copy link
Contributor

Fixed in the MFTF 2.5.1 tagged release that we cut earlier today. Thank you for your report @magicsunday!

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

No branches or pull requests

2 participants