-
Notifications
You must be signed in to change notification settings - Fork 11.2k
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] GitHub Actions will run test suite in Windows #33054
[6.x] GitHub Actions will run test suite in Windows #33054
Conversation
I wonder if we should do 7.2 prefer lowest as well, on Windows. So we have a highest and lowest test. |
Adding PHP 7.2/prefer-lowest makes
So a weird hardcoded fix would have to be added to the test (running Windows, have old league/flysystem installed) or that package will have to be bumped |
I think we should bump the minimum version of flysystem to fix that bug. This is the purpose of prefer-lowest. To catch this kind of thing. :) Please make the change in all composer.json files that require flysystem, such as the filesystem componen's composer.json. |
I discovered another PHP 7.2 on Windows problem. Windows' kernel delays directory deletion so the next
The PHP script also can't immediately create the directory again while the kernel has its delete operation queued and PHP 7.2 asserts the directory already exists. Making class FilesystemTest extends TestCase
{
private static $tempDir;
/**
* @beforeClass
*/
public static function setUpTempDir()
{
self::$tempDir = __DIR__.'/tmp';
mkdir(self::$tempDir);
}
/**
* @afterClass
*/
public static function tearDownTempDir()
{
$files = new Filesystem;
$files->deleteDirectory(self::$tempDir);
self::$tempDir = null;
}
protected function tearDown(): void
{
m::close();
$files = new Filesystem;
$files->deleteDirectory(self::$tempDir, $preserve = true);
}
// then change each $this->tempDir & mkdir() call that follows I'm thinking ignorance is bliss when it comes to complete PHP 7.2 support. |
081905a
to
1010a19
Compare
It's passing now in each environment. Summary:
|
Hey @derekmd. This is looking good. Thanks for that. Is there any way to consolidate the job into one? I'm not sure how much work that'd be?
|
It would be an absolute mess. The current layout is the smallest filesize of the config file I think. |
I think this issue also affects docker too, so we are also fixing that at the same time. 🚀 |
In that case, can we please also test 7.3 on Windows? |
I thought this was already discussed and we wanted to reduce the number of builds? |
If we want to be comprehensive, we should do all 6 builds on Windows. |
Think it's best that we just test on the stable version of 7.2, 7.3 and 7.4 |
We already have prefer-lowest working, though? It's important we also test that. |
Then let's just test lowest for 7.2 and stable for 7.3 and 7.4 |
FilesystemAdapterTest::testPath() fails when run on Windows using 1.0.8. A Windows-only change added in 1.0.34 meets the behavior Laravel expects for file paths.
The test cases re-using subdirectory __DIR__.'/tmp/foo' causes issues when running PHP 7.2 on Windows. The kernel's directory deletetion operating is async so the next PHPUnit test case is starting before directory deletion has completed for the previous test. 1. create __DIR__.'/tmp' only once for FilesystemTest by using PHPUnit @beforeClass and @afterclass annotations. 2. make each test use a unique subdirectory name so there is no overlap / leakage between tests when mkdir() is called.
* Only once run on PHP 7.4 with the latest stable Composer packages installed. The Linux strategy matrix will discover issues in PHP 7.2 & 7.3. * Don't install PHP extension 'pcntl' that isn't available on Windows. * Some extensions must be explicitly setup on Windows. e.g., pdo_mysql, fileinfo, ftp * php.ini 'memory_limit' must be increased 128M to 512M when running all PHPUnit tests synchronously. * Some GitHub Actions workflow configs don't work in Windows because containers only work on Linux: * MySQL server * Redis server. There are no native Windows binaries for Redis so a clone like Memurai would have to be manually setup. * Memcached The above absent services will cause some tests to be skipped. * Skip CI-only tests when running Windows Server 2019 since mysqld.exe isn't available. * Further increase testRetry*()'s margin of error for assertEqualsWithDelta(). The call is meant to be delayed 100ms but Github Actions' virtual env returns up to 110.3ms.
dd8995b
to
4093c2a
Compare
#32975 made all tests green in Windows when run locally. This attempts to keep that going forward.
Add one more GitHub Actions run for PHP 7.4 on Windows Server 2019.
Unfortunately tests requiring these external services must be skipped:
GitHub Actions' service containers only work in Linux environments. The Windows build only offers the mysql.exe client but no local server. To setup any of those services, they would be need to be instances external to the virtual environment. See: slow and costly.
retry()
unit tests need an even longer delta check since 100ms is apparently 110.3ms in CI thanks to the Windows' kernelSleep()
function.3% of the tests (137 of 4938) will be skipped in Windows however pull request feedback for the remaining 97% has value.