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
PHP options should be passed to child processes #3506
Comments
@krakjoe FYI |
Maybe related to #3492 |
So here's what I got, I think this isn't too bad ... This in Runtime (but with a better name):
and this in AbstractPhpProcess::getCommand
This is working for xdebug and pcov ... Any thoughts ? EDIT: php_ini_loaded_file may return false, but you get the gist of it ... |
For Pcov, "production" default is PCOV.enabled=0, and why was thinking to use it this way, using the command line option. For XDebug, this is a bit different, as there is no "enable" option (may have to be enabled using -d zend_extension=xdebug, but this can be another issue because of extension load order). |
There is The main thing we want to achieve is to make sure the child process is always run with the settings of the parent and the current approach cannot do that because it cannot access the configuration set with -d. Looking at it fresh this morning, I'm not sure if a simple array_merge may be what we want, or we may want to merge the passed settings into the system ones the other way round than I did it in the example code ... |
This issue has been automatically marked as stale because it has not had activity within the last 60 days. It will be closed after 7 days if no further activity occurs. Thank you for your contributions. |
@sebastianbergmann can we get some input on this please ? |
Child processes currently do not "inherit" PHP options. They probably should. #3506 (comment) is hard for me to look at / review / judge. A pull request would make it a lot easier for me to review what you propose. |
ack, will do pulls ... |
Thanks! And sorry for dropping the ball on this. |
@krakjoe Did you get a chance to work on this yet? Thanks! |
Just wanted to double check - this is fixed in PHP Unit 9 because it uses a later version of sebastian/environment that has the fix? No chance of a fix for 8.5? |
AFAICS, sebastianbergmann/environment@61420aa is in version 4.2.0 and up of this component. And 4.x is what PHPUnit 8.5 uses. |
I think we can confirm this is still occurring in PHPUnit 8.5. Command line PHP options, ie -d options, are not being passed on to tests that have @runInSeparateProcess. Maybe it's more specifically #3492, the d=xdebug.so is not passing on. Worth reopening that ticket or this more generic one? |
Just opened a new issue. It is not working for me. Could you confirm? |
Playing with pcov...
When enabled (in php.ini), everything OK
When disabled globally, and only enabled in command line, it fails
With some errors like: "No code coverage driver available"
The text was updated successfully, but these errors were encountered: