[3.0][Testing] Run the unit tests on Windows as well as Linux - #9601
Conversation
|
The two new jobs here are red, and it is the failure #9595 reports rather than anything about the matrix. Both Windows runs got through all 169 tests with only
I ran the two branches together on a throwaway pull request in my own fork to confirm nothing else is waiting behind it, and all four jobs pass — ubuntu 8.4, ubuntu 8.5, windows 8.4, windows 8.5. So merging #9600 first turns this one green with no further changes. |
|
Rebase this PR and they should pass. |
|
not yet; I think the test might be too brittle. |
The suite needs no database, no server and no Docker, so the only cost of a second operating system in the matrix is the runner time. Windows is where path handling, directory separators and line endings diverge, and those are exactly the things the suite has no other way of catching. The tests are started through composer rather than vendor/bin/phpunit, since that is the entry point that resolves to the right binary on either platform. Signed-off-by: albertlast <mathiaspapealbert@hotmail.com>
6badf94 to
a2c9a2d
Compare
The installer refuses to run without fileinfo or mbstring, and the runner does not enable either everywhere, so naming them keeps the job honest about what the code is entitled to assume. Signed-off-by: albertlast <mathiaspapealbert@hotmail.com>
|
Green on all four jobs now — ubuntu and windows, 8.4 and 8.5. Rebasing onto a The runner's PHP has no So the second commit names the extensions in the Worth noting separately that the loop guard is doing something surprising here. |
Description
#9595 asked whether the unit tests should run on Windows in CI. This does that.
The suite needs no database, no server and no Docker — it is PHPUnit against
Sources/with the constantstests/bootstrap.phpdefines — so the only cost of a second operating system in the matrix is runner time. What it buys is coverage of the one place the two platforms genuinely differ: path handling, directory separators and line endings. Nothing else in CI looks at those, and #9595 is what that gap looks like in practice.Two changes:
os: [ ubuntu-latest, windows-latest ]in the matrix, withruns-on: ${{ matrix.os }}. The Composer cache key already begins with${{ runner.os }}, so the two platforms keep separate caches and the Windows one gets its own.batproxies.composer testrather thanvendor/bin/phpunit. The default shell on a Windows runner is PowerShell, which cannot execute the extensionless Composer proxy; going through Composer resolves to the right binary on either platform, and it is the commandAGENTS.mdalready tells contributors to run.--colors=alwaysis forwarded to PHPUnit unchanged..gitattributesforceseol=lf, so a Windows checkout gets the same bytes as a Linux one and nothing here depends on that being true.This needs #9600 first.
SapiTest::testCanonicalPathResolvesDotSegments()fails on Windows onrelease-3.0today, which is the bug #9595 reports, so the two new jobs here will be red until that one is merged.Issues References (Fixes|Related|Closes)
SapiTestfails on Windows #9595