Migrate integration tests from SVN to wp-env #182
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
The plugin's integration tests relied on a legacy SVN-based setup that downloads the WordPress test suite directly from the WordPress.org repository. This approach has become problematic: GitHub-hosted runners no longer include SVN by default, causing test failures in CI. Beyond the immediate breakage, the SVN-based method creates inconsistency between local development environments and CI, complicating debugging and maintenance. The infrastructure has aged out of modern WordPress development practices.
Solution
This pull request modernises the integration test infrastructure by migrating to wp-env, WordPress's officially recommended testing environment. The wp-env approach uses Docker containers to provide a consistent, reproducible WordPress environment that works identically in both local development and CI contexts.
The workflow now installs and starts wp-env before running tests, eliminating the need for manual MySQL service configuration and SVN-based downloads. The 182-line
bin/install-wp-tests.shscript has been removed entirely, as wp-env handles all environment provisioning. Composer scripts have been renamed to better reflect their purpose (test→test-integration,test-ms→test-integration-ms), and yoast/phpunit-polyfills ^2.0 has been added to maintain compatibility with PHPUnit 9 whilst supporting broader PHP version testing.The existing
.wp-env.jsonconfiguration means the plugin was already prepared for this migration; this pull request completes the transition by updating the CI infrastructure to match. Tests continue to run against the same WordPress versions and configurations, but now through a more maintainable and reliable mechanism that aligns with community standards.🤖 Generated with Claude Code