Skip to content

Validate build:project was run before attempting to generate tests #61

Closed
@okolesnyk

Description

@okolesnyk

If you attempt to run generate:tests before building the project and setting up the .env file with valid credentials a PHP error is thrown whilst trying to resolve the environment variables.

> /acceptance on MAGETWO-66176-column-configuration ⨯ vendor/bin/robo generate:tests                                                             09:41:33
PHP Notice:  Undefined index: MAGENTO_ADMIN_USERNAME in /dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Util/ModuleResolver.php on line 196

Notice: Undefined index: MAGENTO_ADMIN_USERNAME in /dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Util/ModuleResolver.php on line 196
PHP Notice:  Undefined index: MAGENTO_ADMIN_PASSWORD in /dev/build/bluefoot/dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Util/ModuleResolver.php on line 197

Notice: Undefined index: MAGENTO_ADMIN_PASSWORD in /dev/build/bluefoot/dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Util/ModuleResolver.php on line 197
 [error]  Could not resolve entity reference {{_ENV.MAGENTO_ADMIN_USERNAME}} in Test "LoginAsAdmin" in Cest "AdminLoginCest" 
ERROR: Undefined index: MAGENTO_ADMIN_PASSWORD 
in /dev/tests/acceptance/vendor/magento/magento2-functional-testing-framework/src/Magento/FunctionalTestingFramework/Util/ModuleResolver.php:197

Alternatively validation must present before a command runs which verifies project is ready for test generation and running. In the event of a failure a nice user friendly error can be returned to help prompt the user how to resolve the issue.
"Please run vendor/bin.robo build:project and configure your environment (.env) first."

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions