Skip to content

Commit b22c74e

Browse files
GaryJonesclaude
andcommitted
Migrate integration tests to use wp-env
Replace SVN-based test setup with @wordpress/env. Changes: - Use wp-env to set up WordPress test environment - Update matrix: 'latest' → '6.8', 'trunk' → 'master' - Rename composer scripts: test/test-ms → test-integration/test-integration-ms - Remove SVN dependency 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent d5a9381 commit b22c74e

File tree

2 files changed

+12
-28
lines changed

2 files changed

+12
-28
lines changed

.github/workflows/integrations.yml

Lines changed: 10 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,14 @@ jobs:
4141
- name: Checkout code
4242
uses: actions/checkout@v4
4343

44+
- name: Install wordpress environment
45+
run: npm install -g @wordpress/env
46+
4447
- name: Setup PHP ${{ matrix.php }}
4548
uses: shivammathur/setup-php@v2
4649
with:
4750
php-version: ${{ matrix.php }}
51+
tools: composer
4852

4953
- name: Install Composer dependencies
5054
uses: ramsey/composer-install@v3
@@ -57,25 +61,13 @@ jobs:
5761
- name: Setup Problem Matchers for PHPUnit
5862
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
5963

60-
- name: Show PHP and PHPUnit version info
61-
run: |
62-
php --version
63-
./vendor/bin/phpunit --version
64-
65-
- name: Start MySQL Service
66-
run: sudo systemctl start mysql.service
67-
68-
# This is needed as the integration tests use SVN to download the WordPress core and test dependencies.
69-
- name: Install SVN (Subversion)
70-
run: |
71-
sudo apt-get update
72-
sudo apt-get install subversion
73-
74-
- name: Prepare environment for integration tests
75-
run: composer prepare-ci ${{ matrix.wordpress }}
64+
- name: Setup wp-env
65+
run: wp-env start
66+
env:
67+
WP_ENV_CORE: WordPress/WordPress#${{ matrix.wordpress }}
7668

7769
- name: Run integration tests (single site)
78-
run: composer test
70+
run: composer test-integration
7971

8072
- name: Run integration tests (multisite)
81-
run: composer test-ms
73+
run: composer test-integration-ms

composer.json

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -45,16 +45,8 @@
4545
"lint-ci": [
4646
"@php ./vendor/php-parallel-lint/php-parallel-lint/parallel-lint . -e php --exclude vendor --exclude .git --checkstyle"
4747
],
48-
"prepare-ci": [
49-
"bash bin/install-wp-tests.sh wordpress_test root root localhost"
50-
],
51-
"test": [
52-
"@php ./vendor/bin/phpunit --testsuite WP_Tests"
53-
],
54-
"test-ms": [
55-
"@putenv WP_MULTISITE=1",
56-
"@composer test"
57-
]
48+
"test-integration": "wp-env run tests-cli --env-cwd=wp-content/plugins/zoninator ./vendor/bin/phpunit --testsuite WP_Tests",
49+
"test-integration-ms": "wp-env run tests-cli --env-cwd=wp-content/plugins/zoninator /bin/bash -c 'WP_MULTISITE=1 ./vendor/bin/phpunit --testsuite WP_Tests'"
5850
},
5951
"support": {
6052
"issues": "https://github.com/Automattic/zoninator/issues",

0 commit comments

Comments
 (0)