-
Notifications
You must be signed in to change notification settings - Fork 26
Improve compatibility with other operating systems #274
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
base: main
Are you sure you want to change the base?
Conversation
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.
Pull Request Overview
This PR improves Windows compatibility for the WP-CLI test framework by replacing shell commands with PHP native functions where possible, ensuring cross-platform path handling, and adding Windows-specific code paths.
Key changes:
- Replaced
grepandexeccommands with PHPglob(),file_get_contents(), andpreg_match_all()for parsing Behat feature tags - Replaced
curlcommands withUtils\http_request()for downloading files - Replaced
rm -rfandcp -rcommands with PHP'sRecursiveIteratorIteratorfor directory operations - Added Windows-specific handling for process management, path separators, and executable detection
Reviewed Changes
Copilot reviewed 10 out of 11 changed files in this pull request and generated 17 comments.
Show a summary per file
| File | Description |
|---|---|
| utils/behat-tags.php | Replaced shell grep commands with PHP file operations and regex matching for cross-platform tag parsing |
| tests/tests/TestBehatTags.php | Added remove_dir() helper and run_behat_tags_script() method with Windows-specific command building |
| src/Context/GivenStepDefinitions.php | Replaced curl command with Utils\http_request() for file downloads |
| src/Context/FeatureContext.php | Extensive changes including Windows binary detection (wp.bat), process termination, directory operations, and environment variable handling |
| phpunit.xml.dist | Removed unused test directory specification |
| phpstan.neon.dist | Removed ignoreErrors entry that is no longer needed |
| features/testing.feature | Updated test to verify new DISABLE_WP_CRON constant check format |
| features/steps.feature | Updated regex to match both wp and wp.bat in output |
| composer.json | Updated wp-cli/wp-cli dependency from ^2.12 to ^2.13 |
| bin/install-package-tests | Fixed spelling of "Prompt" and corrected color code format |
| .github/workflows/testing.yml | Added test matrix entries for macOS and Windows with MySQL and SQLite configurations |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <[email protected]>
I'm trying to improve Windows support a little bit so that tests could run on CI. Doing things in PHP vs. CLI commands is one step.
Lots of AI code changes in here, might need some cleanup
Main change is blocked by wp-cli/wp-cli#6124To-do:
See #155