From 41ec81c907a82ad5d341c3efc6ebcc52ac7c8944 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 27 Nov 2026 17:11:58 +0000 Subject: [PATCH] Allow the checksum warning when replacing a development build Many scenarios start from `Given a WP install` and then replace it with an older release, or update it in place. Core-command then cleans up files by comparing checksums of the old and new versions. When the installed version is a development build (for example when testing against a WordPress core build), there are no published checksums for it, so the command prints a warning and `When I run` fails on STDERR. These steps now use `When I try` and check the return code instead, following the existing "May produce warnings if checksums cannot be retrieved" steps in core-update.feature. Their STDOUT assertions are unchanged. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01CE81GsxUY597AdaMP1NXzk --- features/core-check-update-db.feature | 8 ++- features/core-check-update.feature | 6 +- features/core-update-db.feature | 20 ++++-- features/core-update.feature | 87 ++++++++++++++++++--------- features/core-version.feature | 4 +- 5 files changed, 87 insertions(+), 38 deletions(-) diff --git a/features/core-check-update-db.feature b/features/core-check-update-db.feature index 17dcb5d03..1fb6930c4 100644 --- a/features/core-check-update-db.feature +++ b/features/core-check-update-db.feature @@ -18,7 +18,9 @@ Feature: Check if WordPress database update is needed """ twentytwenty """ - And I run `wp core download --version=5.4 --force` + # May produce a warning if the checksums for the version being replaced cannot be retrieved, e.g. for a development build. + And I try `wp core download --version=5.4 --force` + And the return code should be 0 And I run `wp option update db_version 45805 --require=disable_sidebar_check.php` When I try `wp core check-update-db` @@ -66,7 +68,9 @@ Feature: Check if WordPress database update is needed """ twentytwenty """ - And I run `wp core download --version=6.6 --force` + # May produce a warning if the checksums for the version being replaced cannot be retrieved, e.g. for a development build. + And I try `wp core download --version=6.6 --force` + And the return code should be 0 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` diff --git a/features/core-check-update.feature b/features/core-check-update.feature index 8fc78d3c1..b1da7c781 100644 --- a/features/core-check-update.feature +++ b/features/core-check-update.feature @@ -9,8 +9,10 @@ Feature: Check for more recent versions twentytwenty """ - When I run `wp core download --version=5.8 --force` - Then STDOUT should not be empty + # May produce a warning if the checksums for the version being replaced cannot be retrieved, e.g. for a development build. + When I try `wp core download --version=5.8 --force` + Then the return code should be 0 + And STDOUT should not be empty When I run `wp core check-update --format=csv` Then STDOUT should match #{WP_VERSION-latest},major,https://downloads.(w|wordpress).org/release/wordpress-{WP_VERSION-latest}.zip# diff --git a/features/core-update-db.feature b/features/core-update-db.feature index 744dba4e0..d522209ff 100644 --- a/features/core-update-db.feature +++ b/features/core-update-db.feature @@ -18,7 +18,9 @@ Feature: Update core's database """ twentytwenty """ - And I run `wp core download --version=5.4 --force` + # May produce a warning if the checksums for the version being replaced cannot be retrieved, e.g. for a development build. + And I try `wp core download --version=5.4 --force` + And the return code should be 0 And I run `wp option update db_version 45805 --require=disable_sidebar_check.php` When I run `wp core update-db` @@ -51,7 +53,9 @@ Feature: Update core's database """ twentytwenty """ - And I run `wp core download --version=5.4 --force` + # May produce a warning if the checksums for the version being replaced cannot be retrieved, e.g. for a development build. + And I try `wp core download --version=5.4 --force` + And the return code should be 0 And I run `wp option update db_version 45805 --require=disable_sidebar_check.php` When I run `wp core update-db --dry-run` @@ -85,7 +89,9 @@ Feature: Update core's database """ twentytwenty """ - And I run `wp core download --version=5.4 --force` + # May produce a warning if the checksums for the version being replaced cannot be retrieved, e.g. for a development build. + And I try `wp core download --version=5.4 --force` + And the return code should be 0 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` @@ -133,7 +139,9 @@ Feature: Update core's database """ twentytwenty """ - And I run `wp core download --version=5.4 --force` + # May produce a warning if the checksums for the version being replaced cannot be retrieved, e.g. for a development build. + And I try `wp core download --version=5.4 --force` + And the return code should be 0 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` @@ -193,7 +201,9 @@ Feature: Update core's database """ twentytwenty """ - And I run `wp core download --version=5.4 --force` + # May produce a warning if the checksums for the version being replaced cannot be retrieved, e.g. for a development build. + And I try `wp core download --version=5.4 --force` + And the return code should be 0 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) diff --git a/features/core-update.feature b/features/core-update.feature index 288e6faec..ea230c00e 100644 --- a/features/core-update.feature +++ b/features/core-update.feature @@ -9,8 +9,10 @@ Feature: Update WordPress core twentytwenty """ - When I run `wp core download --version=6.2 --force` - Then STDOUT should not be empty + # May produce a warning if the checksums for the version being replaced cannot be retrieved, e.g. for a development build. + When I try `wp core download --version=6.2 --force` + Then the return code should be 0 + And STDOUT should not be empty When I try `wp eval 'echo $GLOBALS["wp_version"];'` Then STDOUT should be: @@ -43,8 +45,10 @@ Feature: Update WordPress core twentytwenty """ - When I run `wp core download --version=6.6 --force` - Then STDOUT should not be empty + # May produce a warning if the checksums for the version being replaced cannot be retrieved, e.g. for a development build. + When I try `wp core download --version=6.6 --force` + Then the return code should be 0 + And STDOUT should not be empty When I run `wp eval 'echo $GLOBALS["wp_version"];'` Then STDOUT should be: @@ -67,8 +71,10 @@ Feature: Update WordPress core twentytwenty """ - When I run `wp core download --version=6.6 --force` - Then STDOUT should not be empty + # May produce a warning if the checksums for the version being replaced cannot be retrieved, e.g. for a development build. + When I try `wp core download --version=6.6 --force` + Then the return code should be 0 + And STDOUT should not be empty When I run `wp eval 'echo $GLOBALS["wp_version"];'` Then STDOUT should be: @@ -92,8 +98,10 @@ Feature: Update WordPress core twentytwenty """ - When I run `wp core download --version=6.6 --force` - Then STDOUT should not be empty + # May produce a warning if the checksums for the version being replaced cannot be retrieved, e.g. for a development build. + When I try `wp core download --version=6.6 --force` + Then the return code should be 0 + And STDOUT should not be empty When I run `wp eval 'echo $GLOBALS["wp_version"];'` Then STDOUT should be: @@ -116,8 +124,10 @@ Feature: Update WordPress core twentytwenty """ - When I run `wp core download --version=6.2.5 --force` - Then STDOUT should contain: + # May produce a warning if the checksums for the version being replaced cannot be retrieved, e.g. for a development build. + When I try `wp core download --version=6.2.5 --force` + Then the return code should be 0 + And STDOUT should contain: """ Success: WordPress downloaded. """ @@ -156,8 +166,10 @@ Feature: Update WordPress core """ And an empty cache - When I run `wp core update --version=6.2.5 --force` - Then STDOUT should not contain: + # May produce a warning if the checksums for the version being replaced cannot be retrieved, e.g. for a development build. + When I try `wp core update --version=6.2.5 --force` + Then the return code should be 0 + And STDOUT should not contain: """ Using cached file """ @@ -182,7 +194,9 @@ Feature: Update WordPress core @require-php-7.4 Scenario: Don't run update when up-to-date Given a WP install - And I run `wp core update` + # May produce a warning if the checksums for the version being replaced cannot be retrieved, e.g. for a development build. + And I try `wp core update` + And the return code should be 0 When I run `wp core update` Then STDOUT should contain: @@ -242,8 +256,11 @@ Feature: Update WordPress core ); """ - When I run `wp core download --version=6.5.2 --force` - And I run `wp core update` + # May produce a warning if the checksums for the version being replaced cannot be retrieved, e.g. for a development build. + When I try `wp core download --version=6.5.2 --force` + Then the return code should be 0 + + When I run `wp core update` Then STDOUT should contain: """ Success: WordPress updated successfully. @@ -285,8 +302,10 @@ Feature: Update WordPress core twentytwenty """ - When I run `wp core update --version=4.4 --force` - Then the wp-includes/rest-api.php file should exist + # May produce a warning if the checksums for the version being replaced cannot be retrieved, e.g. for a development build. + When I try `wp core update --version=4.4 --force` + Then the return code should be 0 + And the wp-includes/rest-api.php file should exist And the wp-includes/class-wp-comment.php file should exist And STDOUT should not contain: """ @@ -325,8 +344,10 @@ Feature: Update WordPress core twentytwenty """ - When I run `wp core update --version=5.8 --force` - Then the wp-includes/Requests/Transport/cURL.php file should exist + # May produce a warning if the checksums for the version being replaced cannot be retrieved, e.g. for a development build. + When I try `wp core update --version=5.8 --force` + Then the return code should be 0 + And the wp-includes/Requests/Transport/cURL.php file should exist And the wp-includes/Requests/Exception/Transport/cURL.php file should exist And the wp-includes/Requests/Exception/HTTP/502.php file should exist And the wp-includes/Requests/IRI.php file should exist @@ -366,8 +387,10 @@ Feature: Update WordPress core Scenario Outline: Use `--version=(nightly|trunk)` to update to the latest nightly version Given a WP install - When I run `wp core update --version=` - Then STDOUT should contain: + # May produce a warning if the checksums for the version being replaced cannot be retrieved, e.g. for a development build. + When I try `wp core update --version=` + Then the return code should be 0 + And STDOUT should contain: """ Updating to version nightly (en_US)... Downloading update from https://wordpress.org/nightly-builds/wordpress-latest.zip... @@ -411,8 +434,10 @@ Feature: Update WordPress core Scenario: Allow installing major version with trailing zero Given a WP install - When I run `wp core update --version=6.2.0 --force` - Then STDOUT should contain: + # May produce a warning if the checksums for the version being replaced cannot be retrieved, e.g. for a development build. + When I try `wp core update --version=6.2.0 --force` + Then the return code should be 0 + And STDOUT should contain: """ Success: """ @@ -456,7 +481,9 @@ Feature: Update WordPress core Scenario: Old files from $_old_files are cleaned up when upgrading Given a WP install - When I run `wp core download --version=6.8 --force` + # May produce a warning if the checksums for the version being replaced cannot be retrieved, e.g. for a development build. + When I try `wp core download --version=6.8 --force` + Then the return code should be 0 # Create files that should be removed according to 6.9 old_files list Given a wp-includes/blocks/post-author/editor.css file: @@ -498,8 +525,10 @@ Feature: Update WordPress core Scenario: Old files cleanup works when checksums unavailable Given a WP install - When I run `wp core download --version=6.8 --force` - Then STDOUT should contain: + # May produce a warning if the checksums for the version being replaced cannot be retrieved, e.g. for a development build. + When I try `wp core download --version=6.8 --force` + Then the return code should be 0 + And STDOUT should contain: """ Success: WordPress downloaded. """ @@ -628,8 +657,10 @@ Feature: Update WordPress core """ And the return code should be 0 - When I run `wp core update --version=6.0 --force` - Then STDOUT should contain: + # May produce a warning if the checksums for the version being replaced cannot be retrieved, e.g. for a development build. + When I try `wp core update --version=6.0 --force` + Then the return code should be 0 + And STDOUT should contain: """ Updating to version 6.0 """ diff --git a/features/core-version.feature b/features/core-version.feature index b46b47c30..0ce8edec8 100644 --- a/features/core-version.feature +++ b/features/core-version.feature @@ -2,7 +2,9 @@ Feature: Find version for WordPress install Scenario: Verify core version Given a WP install - And I run `wp core download --version=4.4.2 --force` + # May produce a warning if the checksums for the version being replaced cannot be retrieved, e.g. for a development build. + And I try `wp core download --version=4.4.2 --force` + And the return code should be 0 When I run `wp core version` Then STDOUT should be: