-
Notifications
You must be signed in to change notification settings - Fork 11k
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
[6.x] Fix Filesystem tests failing in Windows #32975
[6.x] Fix Filesystem tests failing in Windows #32975
Conversation
* testPutWithStreamInterface() leaves an fopen() stream resource that must be explicitly closed before temp directories can be deleted in Windows. * testReplaceStoresFiles() fails for multiple reasons under Windows. chmod() / umask() write permissions don't change and symlink() attempts fail in most Windows environments.
@derekmd That's great. Might be worth to flip the switch on parallel builds in Github actions? |
@driesvints: For my 100% pass test run on desktop some cases were skipped from PHP extensions not being available. Specifically cases outputting these messages:
If those PHP extensions are installed in CI and pass, the framework should be good to introduce Windows to the parallel builds. The 6.x and 7.x branches are good. I'll have a look at |
@driesvints: I confirmed the three active branches have tests passing in Windows.
Should I look into a branch to add a Windows config to /.github/workflows (maybe just one matrix entry for PHP 7.4) or should I leave that to the core team? |
Feel free to already send in a PR. I'll try to have a look early next week. |
@driesvints: It looks like limitations in GitHub Actions may prevent Windows from being added right now, although I was able to get it passing 97% of the framework's tests.
The 20 failing tests are all MySQL-related. Self-hosted GitHub Actions runners are out of scope (and costly) so the fix to get green would be either:
|
Think skipping the MySQL tests might not be the worst idea. |
This should be the last of it. All tests are now green in Windows.
FilesystemAdapterTest::testPutWithStreamInterface()
#30179 comments noted that
Storage::put()
implementation could leave a stream open by the PHP script. This has caused a chain of filesystem tests to fail in Windows becauseFilesystemAdapterTest::tearDown()
can't delete the temp directory when a "foo.txt" temp file has an activefopen()
stream.GuzzleHttp\Psr7\Stream::__destruct()
is meant to gracefullyfclose($this->stream)
throughGuzzleHttp\Psr7\Stream::__close()
GuzzleHttp\Psr7\Stream::detach()
to fetch stream content, theclose()
method now hits$this->stream === null
so it's on userland to explicitly callfclose()
.FilesystemTest::testReplaceStoresFiles()
#26254 added a test that only works in Linux/macOS. The
chmod()
/umask()
write-permission changes have no effect on Windows andsymlink()
fails unless:"{$this->tempDir}/file.txt"
already exists.So I've skipped adding the below Windows-only test as a counterpart to
testReplaceWhenUnixSymlinkExists
.