- Issue created by @murz
- Merge request !10166Issue #3486771: Print the stdout output to the console if the installation fails β (Open) created by murz
- π¦π²Armenia murz Yerevan, Armenia
I make a fix to print stdout output to the console, if the installation fails, please review.
- πΊπΈUnited States smustgrave
Possible to get simple test coverage to make sure this change catches what we think.
- π¦π²Armenia narine_tsaturyan
I applied the proposed fix for printing stdout during installation failures, and it significantly improved the debugging process for me. I was able to quickly pinpoint and resolve errors that were not previously visible in the Nightwatch test output. This enhancement is definitely a valuable addition for developers working with Drupal installations and testing.
Thank you for addressing this! - Status changed to Needs work
2 months ago 2:22pm 13 February 2025 - πΊπ¦Ukraine Joyakas
Thank you, murz.
This solution indeed helps identify non-obvious installation issues faster.
However, in my specific case, the issue was in the response content of the command. It is expected to be valid JSON, but any message from PHP here:- breaks this logic and interrupts the test execution.
- hides the true cause of the problem behind the message "Not a valid JSON near...".
In the logic of the your suggestion, I'd expand an error display for this case.
- π¦π²Armenia murz Yerevan, Armenia
Yeah, I also pretty often face the Nightwatch errors during the Drupal Profile installation that are very unclear:
Installing the profile: commercetools_decoupled_locale_test_profile β NightwatchAssertError Unexpected token W in JSON at position 1
And
Unexpected token E in JSON at position 1
Unexpected token D in JSON at position 1
Actually, this is because during the lunch of the commandphp ./scripts/test-site.php install
Nightwatch expects the valid JSON output, but if we have errors or warnings in the output - it breaks the parsing of the result.In that case, the solution is to output the failed-to-parse JSON to stdout, so your patch works great!
- π¦π²Armenia murz Yerevan, Armenia
Possible to get simple test coverage to make sure this change catches what we think.
@smustgrave, I'm not sure about how to cover this by tests, actually, it will be a functional test for the functional test, that is not good.
This patch just improves outputting the errors to the console, when the Drupal installation fails when installing Drupal for further testing. So, moving to review to get comments about how to make the test coverage, if needed.
The Needs Review Queue Bot β tested this issue. It no longer applies to Drupal core. Therefore, this issue status is now "Needs work".
This does not mean that the patch necessarily needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.
Consult the Drupal Contributor Guide β to find step-by-step guides for working with issues.
- π¦π²Armenia murz Yerevan, Armenia
Attaching a static patch file for Drupal up to 11.1.x with those changes, to make it possible to use in composer until π GitLab Merge Requests Unable to Generate Incremental Patch Files Active is resolved.