Migrate CI integration tests from SVN-based setup to wp-env
Problem
The current GitHub Actions workflow for integration tests uses an SVN-based setup (composer prepare-ci / bin/install-wp-tests.sh) to download WordPress test files. Starting with ubuntu-22.04 (and ubuntu-latest which now points to ubuntu-24.04), Subversion is no longer pre-installed on GitHub Actions runners.
This causes the workflow to fail with:
svn: command not found
Proposed Solution
Migrate to @wordpress/env (wp-env) for running integration tests. This aligns with our plugin standards and provides several benefits:
Why wp-env instead of adding SVN?
- Consistency: Same environment for local development and CI
- No SVN dependency: Eliminates reliance on legacy tooling
- Better isolation: Docker-based environment
- Faster startup: Cached Docker images
- Standard approach: Matches WordPress core/Gutenberg practices and other plugins in this org (e.g., ad-code-manager, liveblog)
Implementation Steps
-
[ ] Ensure
.wp-env.jsonexists and is correctly configured -
[ ] Update
.github/workflows/integrations.ymlto use wp-env pattern:- name: Install wordpress environment run: npm install -g @wordpress/env - name: Setup wp-env run: wp-env start env: WP_ENV_CORE: WordPress/WordPress#${{ matrix.wordpress }} - name: Run integration tests (single site) run: composer test:integration - name: Run integration tests (multisite) run: composer test:integration-ms -
[ ] Update
composer.jsonscripts to run tests via wp-env:{ "scripts": { "test:integration": "wp-env run tests-cli --env-cwd=wp-content/plugins/syndication ./vendor/bin/phpunit --testsuite integration", "test:integration-ms": "wp-env run tests-cli --env-cwd=wp-content/plugins/syndication /bin/bash -c 'WP_MULTISITE=1 ./vendor/bin/phpunit --testsuite integration'" } } -
[ ] Update
tests/bootstrap.phpif needed to work with wp-env's test environment -
[ ] Remove legacy
bin/install-wp-tests.shand relatedcomposer prepare-ciscript if no longer needed -
[ ] Verify tests pass locally and in CI