From 72f99b0be4342af6ed974e914ab187943b4906ee Mon Sep 17 00:00:00 2001 From: Alain Schlesser Date: Fri, 30 Oct 2026 20:44:04 +0100 Subject: [PATCH 1/2] Test wp-cli/wp-cli-tests#400 Co-Authored-By: Claude Opus 5.5 --- composer.json | 2 +- features/core-check-update-db.feature | 6 ++++-- features/core-update-db.feature | 24 ++++++++++++++++-------- 3 files changed, 21 insertions(+), 11 deletions(-) diff --git a/composer.json b/composer.json index 1b38710a..807a5080 100644 --- a/composer.json +++ b/composer.json @@ -20,7 +20,7 @@ "wp-cli/db-command": "^1.3 || ^2 || ^3", "wp-cli/entity-command": "^1.3 || ^2 || ^3", "wp-cli/extension-command": "^1.2 || ^2 || ^3", - "wp-cli/wp-cli-tests": "^5" + "wp-cli/wp-cli-tests": "dev-setup-commands-step as 5.3.99" }, "config": { "process-timeout": 7200, diff --git a/features/core-check-update-db.feature b/features/core-check-update-db.feature index 918cdefd..5ecc9b10 100644 --- a/features/core-check-update-db.feature +++ b/features/core-check-update-db.feature @@ -61,8 +61,10 @@ Feature: Check if WordPress database update is needed """ And I try `wp theme install twentytwenty --activate` And I run `wp core download --version=6.6 --force` - And I run `wp option update db_version 57155 --require=disable_sidebar_check.php` - And I run `wp site option update wpmu_upgrade_site 57155` + And these setup commands: + | command | + | wp option update db_version 57155 --require=disable_sidebar_check.php | + | wp site option update wpmu_upgrade_site 57155 | And I run `wp site create --slug=foo` And I run `wp site create --slug=bar` And I run `wp site create --slug=burrito --porcelain` diff --git a/features/core-update-db.feature b/features/core-update-db.feature index 9df19053..b9492505 100644 --- a/features/core-update-db.feature +++ b/features/core-update-db.feature @@ -77,8 +77,10 @@ Feature: Update core's database """ And I try `wp theme install twentytwenty --activate` And I run `wp core download --version=5.4 --force` - And I run `wp option update db_version 45805 --require=disable_sidebar_check.php` - And I run `wp site option update wpmu_upgrade_site 45805` + And these setup commands: + | command | + | wp option update db_version 45805 --require=disable_sidebar_check.php | + | wp site option update wpmu_upgrade_site 45805 | And I run `wp site create --slug=foo` And I run `wp site create --slug=bar` And I run `wp site create --slug=burrito --porcelain` @@ -122,8 +124,10 @@ Feature: Update core's database """ And I try `wp theme install twentytwenty --activate` And I run `wp core download --version=5.4 --force` - And I run `wp option update db_version 45805 --require=disable_sidebar_check.php` - And I run `wp site option update wpmu_upgrade_site 45805` + And these setup commands: + | command | + | wp option update db_version 45805 --require=disable_sidebar_check.php | + | wp site option update wpmu_upgrade_site 45805 | And I run `wp site create --slug=foo` And I run `wp site create --slug=bar` And I run `wp site create --slug=burrito --porcelain` @@ -179,8 +183,10 @@ Feature: Update core's database """ And I try `wp theme install twentytwenty --activate` And I run `wp core download --version=5.4 --force` - And I run `wp option update db_version 45805 --require=disable_sidebar_check.php` - And I run `wp site option update wpmu_upgrade_site 45805` + And these setup commands: + | command | + | wp option update db_version 45805 --require=disable_sidebar_check.php | + | wp site option update wpmu_upgrade_site 45805 | # Create 2 additional sites in network 1 (main site already exists; 3 total in network 1) And I run `wp site create --slug=net1-site1` And I run `wp site create --slug=net1-site2` @@ -190,8 +196,10 @@ Feature: Update core's database And I run `wp site create --slug=net2-site2 --porcelain` And save STDOUT as {NET2_SITE2_ID} # Register a second network (ID=2) and reassign those two blogs to it - And I run `wp eval 'global $wpdb; $wpdb->insert( $wpdb->site, [ "domain" => "example.com", "path" => "/network2/" ] );'` - And I run `wp eval 'global $wpdb; $wpdb->update( $wpdb->blogs, [ "site_id" => 2 ], [ "blog_id" => {NET2_SITE1_ID} ] ); $wpdb->update( $wpdb->blogs, [ "site_id" => 2 ], [ "blog_id" => {NET2_SITE2_ID} ] );'` + And these setup commands: + | command | + | wp eval 'global $wpdb; $wpdb->insert( $wpdb->site, [ "domain" => "example.com", "path" => "/network2/" ] );' | + | wp eval 'global $wpdb; $wpdb->update( $wpdb->blogs, [ "site_id" => 2 ], [ "blog_id" => {NET2_SITE1_ID} ] ); $wpdb->update( $wpdb->blogs, [ "site_id" => 2 ], [ "blog_id" => {NET2_SITE2_ID} ] );' | When I run `wp site option get wpmu_upgrade_site` Then save STDOUT as {UPDATE_VERSION} From d3450617a3fa7464cb7eda460917dc92e736eb6f Mon Sep 17 00:00:00 2001 From: Alain Schlesser Date: Sat, 31 Oct 2026 00:37:33 +0100 Subject: [PATCH 2/2] Keep commands that change how WordPress is loaded out of shared processes Co-Authored-By: Claude Opus 5.5 --- features/core-check-update-db.feature | 6 ++---- features/core-update-db.feature | 18 ++++++------------ 2 files changed, 8 insertions(+), 16 deletions(-) diff --git a/features/core-check-update-db.feature b/features/core-check-update-db.feature index 5ecc9b10..918cdefd 100644 --- a/features/core-check-update-db.feature +++ b/features/core-check-update-db.feature @@ -61,10 +61,8 @@ Feature: Check if WordPress database update is needed """ And I try `wp theme install twentytwenty --activate` And I run `wp core download --version=6.6 --force` - And these setup commands: - | command | - | wp option update db_version 57155 --require=disable_sidebar_check.php | - | wp site option update wpmu_upgrade_site 57155 | + And I run `wp option update db_version 57155 --require=disable_sidebar_check.php` + And I run `wp site option update wpmu_upgrade_site 57155` And I run `wp site create --slug=foo` And I run `wp site create --slug=bar` And I run `wp site create --slug=burrito --porcelain` diff --git a/features/core-update-db.feature b/features/core-update-db.feature index b9492505..e4d32da5 100644 --- a/features/core-update-db.feature +++ b/features/core-update-db.feature @@ -77,10 +77,8 @@ Feature: Update core's database """ And I try `wp theme install twentytwenty --activate` And I run `wp core download --version=5.4 --force` - And these setup commands: - | command | - | wp option update db_version 45805 --require=disable_sidebar_check.php | - | wp site option update wpmu_upgrade_site 45805 | + And I run `wp option update db_version 45805 --require=disable_sidebar_check.php` + And I run `wp site option update wpmu_upgrade_site 45805` And I run `wp site create --slug=foo` And I run `wp site create --slug=bar` And I run `wp site create --slug=burrito --porcelain` @@ -124,10 +122,8 @@ Feature: Update core's database """ And I try `wp theme install twentytwenty --activate` And I run `wp core download --version=5.4 --force` - And these setup commands: - | command | - | wp option update db_version 45805 --require=disable_sidebar_check.php | - | wp site option update wpmu_upgrade_site 45805 | + And I run `wp option update db_version 45805 --require=disable_sidebar_check.php` + And I run `wp site option update wpmu_upgrade_site 45805` And I run `wp site create --slug=foo` And I run `wp site create --slug=bar` And I run `wp site create --slug=burrito --porcelain` @@ -183,10 +179,8 @@ Feature: Update core's database """ And I try `wp theme install twentytwenty --activate` And I run `wp core download --version=5.4 --force` - And these setup commands: - | command | - | wp option update db_version 45805 --require=disable_sidebar_check.php | - | wp site option update wpmu_upgrade_site 45805 | + And I run `wp option update db_version 45805 --require=disable_sidebar_check.php` + And I run `wp site option update wpmu_upgrade_site 45805` # Create 2 additional sites in network 1 (main site already exists; 3 total in network 1) And I run `wp site create --slug=net1-site1` And I run `wp site create --slug=net1-site2`