Skip to content

issue/24043: add better exception handling for cli commands #24044

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

Merged
merged 3 commits into from
Aug 15, 2019

Conversation

PascalBrouwers
Copy link
Contributor

Description (*)

Fixed Issues (if relevant)

  1. Better exception handling during cli commands #24043: Better exception handling during cli commands

Manual testing scenarios (*)

  1. Have a module with a wrong path in registration.php. For example set the path in vendor/magento/module-catalog/registration.php to DIR . '/wrong_folder'
  2. Run bin/magento setup:upgrade
  3. See that it shows the actual exception (error with module registration)

Questions or comments

Contribution checklist (*)

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • All automated tests passed successfully (all builds are green)

@m2-assistant
Copy link

m2-assistant bot commented Aug 7, 2019

Hi @PascalBrouwers. Thank you for your contribution
Here is some useful tips how you can test your changes using Magento test environment.
Add the comment under your pull request to deploy test or vanilla Magento instance:

  • @magento give me test instance - deploy test instance based on PR changes
  • @magento give me 2.3-develop instance - deploy vanilla Magento instance

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

@rogyar
Copy link
Contributor

rogyar commented Aug 7, 2019

Hi @PascalBrouwers. Thank you for your contribution. Please, check the failing integration tests

@PascalBrouwers
Copy link
Contributor Author

All failures in the tests have nothing to do with the changes in this PR.

@PascalBrouwers
Copy link
Contributor Author

PascalBrouwers commented Aug 12, 2019

@rogyar All failures in the tests have nothing to do with the changes in this PR. So either fix the tests or ignore the messages.

@rogyar
Copy link
Contributor

rogyar commented Aug 12, 2019

Hi @PascalBrouwers. Please, take a look at the following test https://testing-service.magento-community.engineering/reports/magento/magento2/pull/24044/411a2007-03b1-44f0-857d-48083f80b119/26357/Integration/allure-report-ce/index.html#suites/69ab40e7d96841d93275d46d2aeb2a4f/921cbff04d53dd04/
which have an assertion for the CLI output. Since we have expanded the information that is being shown once an error appeared, the assertion fails.

Also, please note that in case if we have an exception upon invoking parent::doRun(https://github.com/magento/magento2/pull/24044/files#diff-4eb287b4e24c054a400e5f7b40dab0cbR105-R107), eventually the $exitCode will be undefined. However, we need a value since we use it for return.

@PascalBrouwers
Copy link
Contributor Author

Ok, i'll make sure the variable exitCode is defined.

@PascalBrouwers
Copy link
Contributor Author

Hmm, the static test is mentioning:
array_merge(...) is used in a loop and is a | | resources greedy construction
But I'm not using array_merge.

@ghost ghost assigned sidolov Aug 14, 2019
@sidolov sidolov added the Auto-Tests: Not Covered Changes in Pull Request requires coverage by auto-tests label Aug 14, 2019
@magento-engcom-team
Copy link
Contributor

Hi @sidolov, thank you for the review.
ENGCOM-5621 has been created to process this Pull Request

@engcom-Alfa
Copy link
Contributor

✔️ QA Passed

Before:
after

After:
1565854091786

@m2-assistant
Copy link

m2-assistant bot commented Aug 15, 2019

Hi @PascalBrouwers, thank you for your contribution!
Please, complete Contribution Survey, it will take less than a minute.
Your feedback will help us to improve contribution process.

@PascalBrouwers
Copy link
Contributor Author

Thank you! Filled in the survey. Took a few tries to be able to login though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Auto-Tests: Not Covered Changes in Pull Request requires coverage by auto-tests Component: Console Partner: H&O partners-contribution Pull Request is created by Magento Partner Progress: accept Release Line: 2.3
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants