Fix Windows test failures: shell quoting, cURL error 77 message, sys_get_temp_dir path mismatch, chmod file permissions#6257
Fix Windows test failures: shell quoting, cURL error 77 message, sys_get_temp_dir path mismatch, chmod file permissions#6257
Conversation
…_temp_dir path Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
…stead of single quotes
- Revert proc_open_compat() bash-wrapping change (no longer needed)
- Convert all eval '...' to eval "..." in feature files, flipping inner PHP
double-quoted strings to single-quoted to avoid escaping conflicts
- For PHP code containing $variables: convert to eval-file with inline PHP
files to avoid shell variable expansion
- config.feature $assoc_args: use compact('assoc_args')['assoc_args'] to
avoid bare $ in the shell command string
- aliases.feature echo "\n": replace with echo 'text' . PHP_EOL;
Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
This comment was marked as resolved.
This comment was marked as resolved.
|
@copilot any idea why the tests might be timing out on Windows? maybe an issue with wp-cli/wp-cli-tests#274? |
…n Windows: skip when chmod() is ineffective Co-authored-by: swissspidy <841956+swissspidy@users.noreply.github.com>
The actual CI failure in the latest run isn't a timeout — it's The installed |
Four Windows-specific failures block the CI matrix added to run tests on
windows-2025. All 203 Behat scenarios fail due to shell quoting incompatibility with PowerShell/cmd.exe, and three PHPUnit tests fail due to platform differences in cURL error messages, temp directory path resolution, and file permission handling.Changes
features/*.feature— Behat Windows shell quoting: PowerShell andcmd.exedo not treat single quotes as string delimiters, sowp eval 'code here'gets tokenized incorrectly. Alleval '...'calls in 14 Behat feature files are converted toeval "..."(double outer quotes), with inner PHP string literals flipped from"to'as needed. For PHP code containing$variablereferences (which would be shell-expanded under double quotes), the eval calls are converted to useeval-filewith inline PHP files via Behat'sGiven a ... file:step. The$assoc_argscase inconfig.featureusescompact('assoc_args')['assoc_args']to avoid any bare$in the shell string.tests/UtilsTest.php—testHttpRequestBadCAcert: Windows cURL error 77 reports"error adding trust anchors from file: ...\wp-5EFE.tmp"instead of"error setting certificate". Assertion narrowed to'cURL error 77:'which is common to both platforms.tests/mock-requests-transport.php—test_http_request_verify@insecure:strpos($verify, sys_get_temp_dir())fails on Windows whensys_get_temp_dir()returns an 8.3 short path (RUNNER~1) whiletempnam()returns the long path (runneradmin). Userealpath()to normalize both sides before comparing.tests/FileCacheTest.php—test_import_do_not_use_cache_file_cannot_be_read:chmod($file, 0000)does not restrict read access on Windows (unlike POSIX), causingFileCache::import()to succeed instead of returningfalse. The test is skipped on Windows withmarkTestSkipped(), consistent with the existing Windows guard already in place for the mkdir permission test in the same class.💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.