-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[PhpUnitBridge] display the command being executed #21083
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
Conversation
If you want to pass environment variables to your tests (for example, to make use of Xdebug), you need to execute the actual process being run by the PHPUnit bridge wrapper. Displaying the commands being executed makes it easier to run them yourself.
but env vars are propagated to the subprocess, aren't they? |
Maybe I am doing something completely wrong, but for me it did not behave that way. |
Maybe this behavior is OS dep? Though I thought this was default behavior of php. |
I investigated this a bit further. The issue does not seem to be that the environment variable is not inherited by the child process, but that Xdebug somehow does not work within the subprocess (maybe because there is still an open connection inside the parent process that blocks the child process from establishing the connection?). In any case, being able to easily figure out what command is actually executed helps to run this very command on your own. |
I experienced the same problem. I'm not sure it's the best solution but on my setup the extension is not loaded at all for CLI to avoid slowing down PHP commands. When I want to debug a script, I run it with I don't think a fix is possible for my use case because, as far as I know, there is no way to detect this runtime configuration to forward it to the child process. But displaying the command so I can run it manually will definitely help. |
an alternative idea could be to not call a sub process but continue in the same for the simple case where no concurrency is involved, if possible |
@nicolas-grekas That's indeed a good idea and it seems to work as expected (see #21112). |
Closing in favor of #21112 |
This PR was merged into the 3.3-dev branch. Discussion ---------- [PhpUnitBridge] run PHPUnit in the same process | Q | A | ------------- | --- | Branch? | master | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #21083 | License | MIT | Doc PR | Commits ------- 1986278 [PhpUnitBridge] run PHPUnit in the same process
If you want to pass environment variables to your tests (for example, to make use of Xdebug), you need to execute the actual process being run by the PHPUnit bridge wrapper. Displaying the commands being executed makes it easier to run them yourself (see also a previous discussion in #18898).