-
-
Notifications
You must be signed in to change notification settings - Fork 117
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
Get PHPUnit running on Windows #2555
Conversation
Huh, that's weird. |
|
||
private function makeEnvDumpProcess(): ProcessBuilder | ||
{ | ||
return ProcessBuilder::create([PHP_BINARY, '-r', 'var_dump($_ENV);']); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
confused why this is necesary when we use mergeParentEnv
- do processes not receive env vars on windows?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They do, but I'm afraid I don't really understand the question. ProcessBuilder (and Process) override that behavior for some reason, and this is a test for it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
right, but the test is "is the env passed to the child process" but here we create the child PHP process and .... - which invalidates the test?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok i see, ignore me, export
is not available on Windows.
I figured out why it wasn't working, apparently |
I am now even more confused by the new failure, which is in a test case I didn't touch. Is this a known flaky test?
|
Shells other than Bash may not have an `export` builtin command (in particular it doesn't exist on Windows). Shells are icky anyway. Let's make our own in one line of PHP. I'm doing this as the first patch towards making PHPUnit pass on Windows, because trying to run a command that doesn't exist triggers a really unpleasant bug in amphp/process 1.x on Windows, where it hangs forever: amphp/process#71 (I had to move `$process->getStdout()` before `$process->join()`, otherwise that would also hang forever. No idea why.)
Otherwise it tries to read from standard input, which is blocking on Windows.
yes it is, you can ignore it, maybe it will be fixed one year :) |
With these patches,
vendor/bin/phpunit
runs to completion on my Windows machine, without crashing the test runner or hanging forever.:)
(the number of errors varies slightly, something must be flapping)