magento / magento2-functional-testing-framework

Magento2 Functional Testing Framework
Other
155 stars 133 forks source link

run:test with --remove not creating testManifest.txt file #906

Open nborgawkar opened 11 months ago

nborgawkar commented 11 months ago

Preconditions

  1. Magento 2.4.6
  2. Magento Functional Testing Framework CLI 4.3.4
  3. PHP 8.1

Steps to reproduce

  1. sudo vendor/bin/mftf run:test AdminQuickCheckoutSalesOrderCreateTest --remove

Expected result

  1. Test should get executed successfully

Actual result

  1. Fatal error
    PHP Warning:  fopen(/var/www/html/salestax/2.4.6/enterprise/dev/tests/acceptance/tests/functional/Magento/_generated/testManifest.txt): Failed to open stream: No such file or directory in /var/www/html/salestax/2.4.6/enterprise/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Util/Manifest/DefaultTestManifest.php on line 68
    PHP Fatal error:  Uncaught TypeError: fwrite(): Argument #1 ($stream) must be of type resource, bool given in /var/www/html/salestax/2.4.6/enterprise/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Util/Manifest/DefaultTestManifest.php:93
    Stack trace:
    #0 /var/www/html/salestax/2.4.6/enterprise/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Util/Manifest/DefaultTestManifest.php(93): fwrite()
    #1 /var/www/html/salestax/2.4.6/enterprise/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Util/Manifest/DefaultTestManifest.php(75): Magento\FunctionalTestingFramework\Util\Manifest\DefaultTestManifest->generateSuiteEntries()
    #2 /var/www/html/salestax/2.4.6/enterprise/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Console/GenerateTestsCommand.php(235): Magento\FunctionalTestingFramework\Util\Manifest\DefaultTestManifest->generate()
    #3 /var/www/html/salestax/2.4.6/enterprise/vendor/symfony/console/Command/Command.php(298): Magento\FunctionalTestingFramework\Console\GenerateTestsCommand->execute()
    #4 /var/www/html/salestax/2.4.6/enterprise/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Console/RunTestCommand.php(133): Symfony\Component\Console\Command\Command->run()
    #5 /var/www/html/salestax/2.4.6/enterprise/vendor/symfony/console/Command/Command.php(298): Magento\FunctionalTestingFramework\Console\RunTestCommand->execute()
    #6 /var/www/html/salestax/2.4.6/enterprise/vendor/symfony/console/Application.php(1040): Symfony\Component\Console\Command\Command->run()
    #7 /var/www/html/salestax/2.4.6/enterprise/vendor/symfony/console/Application.php(301): Symfony\Component\Console\Application->doRunCommand()
    #8 /var/www/html/salestax/2.4.6/enterprise/vendor/symfony/console/Application.php(171): Symfony\Component\Console\Application->doRun()
    #9 /var/www/html/salestax/2.4.6/enterprise/vendor/magento/magento2-functional-testing-framework/bin/mftf(40): Symfony\Component\Console\Application->run()
    #10 /var/www/html/salestax/2.4.6/enterprise/vendor/bin/mftf(119): include('...')
    #11 {main}
    thrown in /var/www/html/salestax/2.4.6/enterprise/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Util/Manifest/DefaultTestManifest.php on line 93
m2-assistant[bot] commented 11 months ago

Hi @nborgawkar. 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.

nborgawkar commented 11 months ago

Few months ago this was working fine but after this recent commit it started to create issue. https://github.com/magento/magento2-functional-testing-framework/commit/6e2dc63429befcc76c1780a79f47bfd8427ee2c7

SuiteGenerator::getInstance()->generateAllSuites($testManifest); function was able to create "_generated" DIR and then testManifest.txt file getting created successfully within _generated DIR but this function get moved after $testManifest->generate(); call and its started to throwing errors because _generated DIR not getting created before creating testManifest.txt file

snez commented 10 months ago

This also happens with run:group groupname -r