Skip to content

Conversation

@GaryJones
Copy link
Collaborator

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.sh script has been removed entirely, as wp-env handles all environment provisioning. Composer scripts have been renamed to better reflect their purpose (testtest-integration, test-mstest-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.json configuration 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

@GaryJones GaryJones self-assigned this Nov 9, 2025
@GaryJones GaryJones added the type: maintenance Routine maintenance and code quality improvements label Nov 9, 2025
@GaryJones GaryJones force-pushed the update/migrate-to-wp-env branch 4 times, most recently from fa704f4 to 9219e72 Compare November 9, 2025 23:45
Modernises the integration test infrastructure to use wp-env instead of
the legacy SVN-based test setup. GitHub-hosted runners no longer include
SVN by default, causing test failures. This migration aligns with
WordPress's recommended testing approach and ensures consistency between
local development and CI environments.

Updates the workflow to install wp-env, removes MySQL service
configuration (now provided by wp-env), and eliminates the prepare-ci
script. The WordPress matrix now uses concrete version numbers ('6.8')
and 'master' instead of 'latest' and 'trunk', as wp-env expects actual
Git branch/tag references.

Removes the Codecov integration from CI (coverage can still be run
locally via composer scripts). Simplifies the matrix by removing
coverage-specific configurations.

Renames composer scripts to reflect their integration test purpose:
test → test-integration, test-ms → test-integration-ms.

Removes bin/install-wp-tests.sh (182 lines) which is no longer needed.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
@GaryJones GaryJones force-pushed the update/migrate-to-wp-env branch from 9219e72 to 6f24cd7 Compare November 9, 2025 23:52
@GaryJones GaryJones merged commit ba533fb into develop Nov 9, 2025
21 checks passed
@GaryJones GaryJones deleted the update/migrate-to-wp-env branch November 9, 2025 23:55
@GaryJones GaryJones added this to the 0.7.2 milestone Dec 14, 2025
@GaryJones GaryJones mentioned this pull request Dec 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: maintenance Routine maintenance and code quality improvements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants