Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
403c547
Add wp-env as an alternative local development environment
dd32 Feb 17, 2026
6e829a5
Fix CI: define WORDCAMP_ENVIRONMENT in PHPUnit bootstrap
dd32 Feb 17, 2026
3fbe57f
Move camptix-* plugins from Composer to wp-env
dd32 Feb 17, 2026
f4b245b
Remove supportflow, move tagregator to wp-env
dd32 Feb 17, 2026
d5c9bb5
Update wp-env PHP version to 8.5
dd32 Feb 17, 2026
244fab0
Update GitHub Actions to use wp-env for PHP tests
dd32 Feb 17, 2026
1a143ab
Remove camptix-* plugins from wp-env
dd32 Feb 17, 2026
89380f0
Move bbpress from Composer SVN to wp-env plugin slug
dd32 Feb 17, 2026
05b888b
Restore SVN install in CI for Composer SVN packages
dd32 Feb 17, 2026
dc61918
Use download URLs for wp-env plugins and themes
dd32 Feb 17, 2026
4dffc68
Remove p2 theme from wp-env (not available on wordpress.org)
dd32 Feb 17, 2026
b05cd73
Add defensive checks for constants in mu-plugins
dd32 Feb 17, 2026
1a88e39
Add fallback constants mu-plugin for wp-env compatibility
dd32 Feb 17, 2026
cdb1175
Add JS build step to CI before wp-env start
dd32 Feb 17, 2026
1264cb4
Add MULTISITE and SUBDOMAIN_INSTALL to fallback constants
dd32 Feb 17, 2026
a0e9703
Revert CI to original workflow, keep wp-env for local dev only
dd32 Feb 17, 2026
03ad3c8
Revert "Add defensive checks for constants in mu-plugins"
dd32 Feb 17, 2026
8ce5feb
Use wp-env for CI, guard sunrise and mu-plugins for missing constants
dd32 Feb 17, 2026
7d3f89b
Simplify sunrise early return: only define WORDCAMP_ENVIRONMENT
dd32 Feb 17, 2026
fbba714
Map wp-env-only mu-plugin for fallback constants during bootstrap
dd32 Feb 17, 2026
8b68b2e
Fix CI: mapping order, missing file guard, PHPCS lint
dd32 Feb 17, 2026
d52d71a
Fix mu-plugin loading during wp-env install
dd32 Feb 17, 2026
374ded7
Skip jetpack-tweaks CSS module during WordPress install
dd32 Feb 17, 2026
d0d1f20
Skip loading sub-folder mu-plugins during WordPress install
dd32 Feb 17, 2026
0e722f5
Fix tests env: override DOMAIN_CURRENT_SITE to localhost
dd32 Feb 17, 2026
9d54bd1
Fix tests env: disable subdomain install for localhost
dd32 Feb 17, 2026
28b7d2f
Move SUBDOMAIN_INSTALL to dev-only config
dd32 Feb 17, 2026
f44a889
Explicitly set SUBDOMAIN_INSTALL=false at top level
dd32 Feb 17, 2026
01efeba
Disable multisite for tests env, use WP_TESTS_MULTISITE instead
dd32 Feb 17, 2026
c1a84f4
Move multisite config to env.development to fix tests env
dd32 Feb 18, 2026
8fe08f9
Guard mu-plugins against single-site test environment
dd32 Feb 18, 2026
a3e5016
Disable dev env multisite in CI to avoid localhost subdomain error
dd32 Feb 18, 2026
7deccb2
Handle single-site gracefully in setup script and fix CI retry
dd32 Feb 18, 2026
cf581e6
Simplify: top-level multisite with CI override
dd32 Feb 18, 2026
1022c42
Move SUNRISE/SUBDOMAIN_INSTALL to lifecycle script
dd32 Feb 18, 2026
81c1c26
Fix duplicate autoloader: use mu-plugins vendor path in bootstrap
dd32 Feb 18, 2026
ca6f73e
Fix autoloader conflict: remove vendor mapping, use mu-plugins path
dd32 Feb 18, 2026
171075d
Guard payments-network test bootstrap against missing private files
dd32 Feb 18, 2026
4ab3fa4
Fix phpunit.xml.dist paths for wp-env container
dd32 Feb 18, 2026
f34694e
Fix test failures: bootstrap constants, autoloader, domain, and test …
dd32 Feb 18, 2026
d30e4d0
Fix PHPCS: remove parentheses from require_once statement
dd32 Feb 18, 2026
9476347
Merge branch 'master' into add/claude/wp-env-setup
dd32 Mar 12, 2026
b597fb3
Resolve a bad merge.
dd32 Mar 12, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 18 additions & 21 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,17 +57,6 @@ jobs:
matrix:
php-version: ['8.1', '8.4', '8.5']

services:
mysql:
image: mysql:5.7
env:
MYSQL_ALLOW_EMPTY_PASSWORD: false
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: wcorg_test
ports:
- 3306/tcp
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3

steps:
- uses: actions/checkout@v4

Expand All @@ -76,26 +65,34 @@ jobs:
sudo rm -f /var/lib/man-db/auto-update # https://github.com/actions/runner-images/issues/10977
sudo apt-get update && sudo apt-get install -y subversion

- name: Set PHP version
- name: Use Node.js 20.x
uses: actions/setup-node@v4
with:
node-version: 20.x

- name: Set up PHP for Composer
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
php-version: '8.1'
coverage: none
tools: composer:v2
env:
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Start mysql service
run: sudo /etc/init.d/mysql start
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Install dependencies
run: |
rm composer.lock || true
composer install
yarn

- name: Install WordPress
run: |
bash .docker/bin/install-wp-tests.sh wcorg_test root root 127.0.0.1 latest
- name: Build JS assets
run: yarn workspaces run build

- name: Configure wp-env for CI
run: echo '{ "phpVersion":"${{ matrix.php-version }}", "multisite":false }' > .wp-env.override.json

- name: Start wp-env
run: npx wp-env start || (echo y | npx wp-env destroy && sleep 10 && npx wp-env start)

- name: Running unit tests
run: ./public_html/wp-content/mu-plugins/vendor/bin/phpunit -c phpunit.xml.dist
run: npx wp-env run tests-cli --env-cwd=/var/www/html /var/www/html/wp-content/mu-plugins/vendor/bin/phpunit -c phpunit.xml.dist
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@
docker-compose.override.yaml


#
# wp-env
#
.wp-env-home
.wp-env.override.json


#
# Misc
#
Expand Down
88 changes: 88 additions & 0 deletions .wp-env.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
{
"core": null,
"phpVersion": "8.5",
"multisite": true,
"port": 80,
"testsPort": 8889,
"plugins": [
"https://downloads.wordpress.org/plugin/akismet.zip",
"https://downloads.wordpress.org/plugin/bbpress.zip",
"https://downloads.wordpress.org/plugin/classic-editor.zip",
"https://downloads.wordpress.org/plugin/custom-content-width.zip",
"https://downloads.wordpress.org/plugin/edit-flow.zip",
"https://downloads.wordpress.org/plugin/email-post-changes.zip",
"https://downloads.wordpress.org/plugin/gutenberg.zip",
"https://downloads.wordpress.org/plugin/jetpack.zip",
"https://downloads.wordpress.org/plugin/liveblog.zip",
"https://downloads.wordpress.org/plugin/public-post-preview.zip",
"https://downloads.wordpress.org/plugin/pwa.zip",
"https://downloads.wordpress.org/plugin/tagregator.zip",
"https://downloads.wordpress.org/plugin/wordpress-importer.zip",
"https://downloads.wordpress.org/plugin/wp-cldr.zip",
"https://downloads.wordpress.org/plugin/wp-super-cache.zip"
],
"themes": [
"https://downloads.wordpress.org/theme/twentyten.zip",
"https://downloads.wordpress.org/theme/twentytwentytwo.zip",
"https://downloads.wordpress.org/theme/twentytwentythree.zip",
"https://downloads.wordpress.org/theme/twentytwentyfour.zip"
],
"config": {
"IS_WORDCAMP_NETWORK": true,
"WP_ENVIRONMENT_TYPE": "local",
"SITE_ID_CURRENT_SITE": 1,
"BLOG_ID_CURRENT_SITE": 5,
"WORDCAMP_NETWORK_ID": 1,
"WORDCAMP_ROOT_BLOG_ID": 5,
"EVENTS_NETWORK_ID": 2,
"EVENTS_ROOT_BLOG_ID": 47,
"CAMPUS_NETWORK_ID": 3,
"CAMPUS_ROOT_BLOG_ID": 47,
"WP_DEBUG": true,
"WP_DEBUG_LOG": true,
"WP_DEBUG_DISPLAY": true,
"SAVEQUERIES": true,
"SCRIPT_DEBUG": false,
"JETPACK_DEV_DEBUG": true,
"DISALLOW_UNFILTERED_HTML": true,
"WORDCAMP_QBO_HMAC_KEY": "localhmac",
"EMAIL_DEVELOPER_NOTIFICATIONS": "developers@example.test",
"EMAIL_CENTRAL_SUPPORT": "support@central.wordcamp.test",
"WORDCAMP_ENVIRONMENT": "local"
},
"mappings": {
"wp-content/mu-plugins": "./public_html/wp-content/mu-plugins",
"wp-content/mu-plugins/0-aaa-wp-env-constants.php": "./.wp-env/0-early-mu-plugin.php",
"wp-content/plugins": "./public_html/wp-content/plugins",
"wp-content/sunrise.php": "./public_html/wp-content/sunrise.php",
"wp-content/sunrise-wordcamp.php": "./public_html/wp-content/sunrise-wordcamp.php",
"wp-content/sunrise-events.php": "./public_html/wp-content/sunrise-events.php",
"wp-content/themes/campsite-2017": "./public_html/wp-content/themes/campsite-2017",
"wp-content/themes/wordcamp-base-v2": "./public_html/wp-content/themes/wordcamp-base-v2",
"wp-content/themes/wporg-events-2023": "./public_html/wp-content/themes/wporg-events-2023",
"wp-content/themes/wporg-flagship-landing": "./public_html/wp-content/themes/wporg-flagship-landing"
},
"lifecycleScripts": {
"afterStart": "node .wp-env/setup.mjs"
},
"env": {
"tests": {
"config": {
"WP_TESTS_MULTISITE": 1,
"BLOG_ID_CURRENT_SITE": 1,
"WORDCAMP_ROOT_BLOG_ID": 1
},
"mappings": {
"wp-content/mu-plugins": "./public_html/wp-content/mu-plugins",
"wp-content/mu-plugins/0-aaa-wp-env-constants.php": "./.wp-env/0-early-mu-plugin.php",
"wp-content/plugins": "./public_html/wp-content/plugins",
"wp-content/sunrise.php": "./public_html/wp-content/sunrise.php",
"wp-content/sunrise-wordcamp.php": "./public_html/wp-content/sunrise-wordcamp.php",
"wp-content/sunrise-events.php": "./public_html/wp-content/sunrise-events.php",
"phpunit.xml.dist": "./phpunit.xml.dist",
"phpunit-bootstrap.php": "./phpunit-bootstrap.php",
"phpunit-database-testcase.php": "./phpunit-database-testcase.php"
}
}
}
}
32 changes: 32 additions & 0 deletions .wp-env/0-early-mu-plugin.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?php
/**
* Wp-env early-loading mu-plugin.
*
* Wp-env runs `wp core install` before `wp config set`, so custom constants
* aren't available when mu-plugins first load during installation. This file
* provides safe defaults so the mu-plugins don't cause fatal errors during
* that initial bootstrap.
*
* This file is mapped into the mu-plugins directory by .wp-env.json and is
* NOT part of the production codebase.
*
* @see https://github.com/WordPress/wordpress-develop/pull/XXXX (proposed wp_get_mu_plugins filter)
*/

$defaults = array(
'WORDCAMP_ENVIRONMENT' => 'local',
'WORDCAMP_NETWORK_ID' => 1,
'WORDCAMP_ROOT_BLOG_ID' => 5,
'EVENTS_NETWORK_ID' => 2,
'EVENTS_ROOT_BLOG_ID' => 47,
'CAMPUS_NETWORK_ID' => 3,
'CAMPUS_ROOT_BLOG_ID' => 47,
'SITE_ID_CURRENT_SITE' => 1,
'BLOG_ID_CURRENT_SITE' => 5,
);

foreach ( $defaults as $name => $value ) {
if ( ! defined( $name ) ) {
define( $name, $value );
}
}
Loading
Loading