-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
Integration Tests Fail with Local PHP Binary in Paths Containing Spaces #38707
Comments
Hi @DavidLambauer. Thank you for your report.
Join Magento Community Engineering Slack and ask your questions in #github channel. |
Hi @engcom-November. Thank you for working on this issue.
|
Hello @DavidLambauer, Thank you for the report and colaboration! Verified this issue on 2.4-develop and 2.4.7 instance. Hence confirming the issue. Thank you. |
✅ Jira issue https://jira.corp.adobe.com/browse/AC-11928 is successfully created for this GitHub issue. |
✅ Confirmed by @engcom-November. Thank you for verifying the issue. |
Here is another occupancy of the issue. This time using
|
Preconditions and environment
When attempting to run integration tests using a local PHP binary located in a path containing spaces, the command fails to execute and produces a "No such file or directory" error. The issue arises due to the lack of escaping for spaces in file paths, specifically when passthru() is used in \Magento\Developer\Console\Command\DevTestsRunCommand.
Preconditions:
Magento 2.4.7 installed.
Local PHP binary path includes spaces, e.g.,
/Users/MYUSER/Library/Application Support/myphp/bin/php81
.Running command
php bin/magento dev:tests:run integration
.Steps to reproduce
Ensure the local PHP binary path contains a space. You can check with
php -r "echo PHP_BINARY;"
Execute the command:
php bin/magento dev:tests:run integration
.Observe the failure in the command line output indicating "No such file or directory".
Expected result
The integration tests should run without errors, regardless of spaces in the PHP binary path.
Actual result
Additional information
Technical Details
The error occurs in
Magento\Developer\Console\Command\DevTestsRunCommand
, line 111:There is no prior validation or escaping of the command string to handle spaces in file paths.
Possible Solution
Replace
passthru()
with\Symfony\Component\Process\Process
to handle command execution. This component properly escapes command line arguments and can manage spaces in paths more reliably.Example of Problematic Usage
Additional Information
This issue only occurs when paths include spaces and using
passthru()
orexec()
for command execution. Utilizing\Symfony\Component\Process\Process
would mitigate this issue by providing more robust command line handling capabilities.Release note
No response
Triage and priority
The text was updated successfully, but these errors were encountered: