Magento2: Running the integration tests fails with 'Error: Cannot instantiate interface...'

Created on 19 Sep 2019  路  4Comments  路  Source: magento/magento2

Preconditions (*)

  1. Magento 2.3-develop branch was installed (PHP 7.2, MySQL 5.7.26, both frontend & admin work fine)
  2. M2 was configured to run integration tests as described at https://devdocs.magento.com/guides/v2.3/test/integration/integration_test_execution.html

Steps to reproduce (*)

  1. Install Magento 2.3-develop branch
  2. cd dev/tests/integration
  3. ../../../vendor/bin/phpunit

Expected result (*)

  1. Expected to run the integration test suite

Actual result (*)

ps@~/Projects/magento2/dev/tests/integration(2.3-develop)$ ../../../vendor/bin/phpunit
PHP Fatal error:  Uncaught Error: Cannot instantiate interface Magento\Framework\App\DesignInterface in /Users/ps/Projects/magento2/lib/internal/Magento/Framework/ObjectManager/Factory/Dynamic/Developer.php:50
Stack trace:
#0 /Users/ps/Projects/magento2/lib/internal/Magento/Framework/ObjectManager/ObjectManager.php(70): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create('Magento\\Framewo...')
#1 /Users/ps/Projects/magento2/lib/internal/Magento/Framework/ObjectManager/Factory/AbstractFactory.php(160): Magento\Framework\ObjectManager\ObjectManager->get('Magento\\Framewo...')
#2 /Users/ps/Projects/magento2/lib/internal/Magento/Framework/ObjectManager/Factory/AbstractFactory.php(246): Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgument(Array, 'Magento\\Framewo...', NULL, 'design', 'Magento\\Framewo...')
#3 /Users/ps/Projects/magento2/lib/internal/Magento/Framework/ObjectManager/Factory/Dynamic/Developer.php(34): Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgumentsInRuntime(' in /Users/ps/Projects/magento2/lib/internal/Magento/Framework/ObjectManager/Factory/Dynamic/Developer.php on line 50

Fatal error: Uncaught Error: Cannot instantiate interface Magento\Framework\App\DesignInterface in /Users/ps/Projects/magento2/lib/internal/Magento/Framework/ObjectManager/Factory/Dynamic/Developer.php:50
Stack trace:
#0 /Users/ps/Projects/magento2/lib/internal/Magento/Framework/ObjectManager/ObjectManager.php(70): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create('Magento\\Framewo...')
#1 /Users/ps/Projects/magento2/lib/internal/Magento/Framework/ObjectManager/Factory/AbstractFactory.php(160): Magento\Framework\ObjectManager\ObjectManager->get('Magento\\Framewo...')
#2 /Users/ps/Projects/magento2/lib/internal/Magento/Framework/ObjectManager/Factory/AbstractFactory.php(246): Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgument(Array, 'Magento\\Framewo...', NULL, 'design', 'Magento\\Framewo...')
#3 /Users/ps/Projects/magento2/lib/internal/Magento/Framework/ObjectManager/Factory/Dynamic/Developer.php(34): Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgumentsInRuntime(' in /Users/ps/Projects/magento2/lib/internal/Magento/Framework/ObjectManager/Factory/Dynamic/Developer.php on line 50

=== Memory Usage System Stats ===
Memory usage (OS):  28.50M (203.57% of 14.00M reported by PHP)
Estimated memory leak:  14.50M (50.88% of used memory)
Format is valid

Most helpful comment

Hi @engcom-Charlie
You're right, turns out I had to specify localhost instead of 127.0.0.1 as mysql host to get the tests working. As usual, the error messages are very helpful in such cases ;) Thanks a lot for your help!

All 4 comments

Hi @psdevhh. Thank you for your report.
To help us process this issue please make sure that you provided the following information:

  • [ ] Summary of the issue
  • [ ] Information on your environment
  • [ ] Steps to reproduce
  • [ ] Expected and actual results

Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:

@magento give me 2.3-develop instance - upcoming 2.3.x release

For more details, please, review the Magento Contributor Assistant documentation.

@psdevhh do you confirm that you were able to reproduce the issue on vanilla Magento instance following steps to reproduce?

  • [ ] yes
  • [ ] no

Hi @engcom-Charlie. Thank you for working on this issue.
In order to make sure that issue has enough information and ready for development, please read and check the following instruction: :point_down:

  • [ ] 1. Verify that issue has all the required information. (Preconditions, Steps to reproduce, Expected result, Actual result).
    DetailsIf the issue has a valid description, the label Issue: Format is valid will be added to the issue automatically. Please, edit issue description if needed, until label Issue: Format is valid appears.
  • [ ] 2. Verify that issue has a meaningful description and provides enough information to reproduce the issue. If the report is valid, add Issue: Clear Description label to the issue by yourself.

  • [ ] 3. Add Component: XXXXX label(s) to the ticket, indicating the components it may be related to.

  • [ ] 4. Verify that the issue is reproducible on 2.3-develop branch

    Details- Add the comment @magento give me 2.3-develop instance to deploy test instance on Magento infrastructure.
    - If the issue is reproducible on 2.3-develop branch, please, add the label Reproduced on 2.3.x.
    - If the issue is not reproducible, add your comment that issue is not reproducible and close the issue and _stop verification process here_!

  • [ ] 5. Add label Issue: Confirmed once verification is complete.

  • [ ] 6. Make sure that automatic system confirms that report has been added to the backlog.

Hello @psdevhh .
I reproduced same errors when i had bad configuration of install-config-mysql.php.dist file.
Please check the data of this file and if you don't use Redis please detele this:
'amqp-host' => 'localhost', 'amqp-port' => '5672', 'amqp-user' => 'guest', 'amqp-password' => 'guest',.
I have to close this issue, but i am waiting for your response.
Thanks for your report!

Hi @engcom-Charlie
You're right, turns out I had to specify localhost instead of 127.0.0.1 as mysql host to get the tests working. As usual, the error messages are very helpful in such cases ;) Thanks a lot for your help!

Was this page helpful?
0 / 5 - 0 ratings