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
Fix: Run commands through PHP binary to ensure they are run on Windows #4335
Fix: Run commands through PHP binary to ensure they are run on Windows #4335
Conversation
45ac914
to
2c85b6b
Compare
Codecov Report
@@ Coverage Diff @@
## 8.5 #4335 +/- ##
============================================
+ Coverage 84.20% 84.63% +0.43%
Complexity 3936 3936
============================================
Files 154 154
Lines 9785 10390 +605
============================================
+ Hits 8239 8794 +555
- Misses 1546 1596 +50
Continue to review full report at Codecov.
|
@@ -141,17 +141,17 @@ jobs: | |||
|
|||
- name: Install lowest dependencies with composer | |||
if: matrix.dependencies == 'lowest' | |||
run: ./tools/composer update --no-ansi --no-interaction --no-progress --prefer-lowest | |||
run: php ./tools/composer update --no-ansi --no-interaction --no-progress --prefer-lowest |
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.
Do you have an idea why it would be necessary to specify the php
binary here for running these commands on windows-latest
?
Without it, they are not run, see #4333.
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.
@localheinz
#!/usr/bin/env php
does not work on Windows, so you will have to call local phar
tools with php
.
When tools are installed using setup-php
on Windows, it creates a batch
script to call the tools with php.
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.
Thank you, @shivammathur!
Tests are running on Looks like most of them are related to line-endings. |
Most of the failures I think will go away if the checkout uses LF, rather than CRLF. Try the workaround on actions/checkout#38 or forcing LF via |
Thank you, @dvdoug - that helped! 👍 |
Does anyone have an idea how to fix the remaining test failures? I haven't used Windows in the last 10 years. |
@localheinz To fix
- $expectedDirectory = __DIR__ . DIRECTORY_SEPARATOR;
+ $expectedDirectory = addslashes(__DIR__ . DIRECTORY_SEPARATOR); to match
Related issue - #3834 |
b2ef482
to
6f90153
Compare
I applied a fix with 77d7158, but I think it did not help. |
@localheinz Try this, I missed phpunit/src/Util/XdebugFilterScriptGenerator.php Lines 67 to 70 in 081dcb4
- $expectedDirectory = __DIR__ . DIRECTORY_SEPARATOR;
+ $expectedDirectory = sprintf(addslashes('%s' . DIRECTORY_SEPARATOR), __DIR__); |
On Windows, Thus unless you want to try and use shell scripting to set up ACLs, I'd suggest simply skipping |
The last failing test tests columns=max which is an implicitly variable number, but has a hard-coded result? I don't think that's a safe expectation as this is now showing. |
fac581f
to
f49b4d1
Compare
Thank you, @dvdoug, @sebastianbergmann, and @shivammathur! |
This PR
windows-latest
git
to avoid issues with line endings when running tests onwindows-latest
Fixes #4333.