From 8bc15f281e6e5a0bb15c3a3dd95be65eaccff3f5 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 27 Nov 2026 15:43:10 +0000 Subject: [PATCH 1/4] Use the scenario's own directory for custom download paths The custom-path download scenarios wrote to fixed /tmp paths, so a second run of the suite on the same machine failed with "Destination file already exists". {RUN_DIR} is unique to each scenario, and the download commands create the target directory when it is missing. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01CE81GsxUY597AdaMP1NXzk --- features/extension-download.feature | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/features/extension-download.feature b/features/extension-download.feature index f05f5eef..d202db30 100644 --- a/features/extension-download.feature +++ b/features/extension-download.feature @@ -19,7 +19,7 @@ Feature: Download WordPress.org extensions without loading WordPress Scenario: Downloading a plugin package to a custom path Given an empty directory - When I run `wp plugin download debug-bar --target-path=/tmp/wp-cli-download-test-plugin` + When I run `wp plugin download debug-bar --target-path={RUN_DIR}/custom-path` Then STDOUT should contain: """ Success: Downloaded plugin package to @@ -103,7 +103,7 @@ Feature: Download WordPress.org extensions without loading WordPress Scenario: Downloading a theme package to a custom path Given an empty directory - When I run `wp theme download twentytwelve --target-path=/tmp/wp-cli-download-test-theme` + When I run `wp theme download twentytwelve --target-path={RUN_DIR}/custom-path` Then STDOUT should contain: """ Success: Downloaded theme package to From 69a810c2e15712a4c6d7024865f4f32456c6d397 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 27 Nov 2026 17:12:40 +0000 Subject: [PATCH 2/4] Allow the checksum warning when replacing a development build Some scenarios start from `Given a WP install` and then replace it with an older release. Core-command 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 `I try` and check the return code instead. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01CE81GsxUY597AdaMP1NXzk --- features/plugin-install.feature | 4 +++- features/theme-install.feature | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/features/plugin-install.feature b/features/plugin-install.feature index 36dfa55d..71991b8a 100644 --- a/features/plugin-install.feature +++ b/features/plugin-install.feature @@ -292,7 +292,9 @@ Feature: Install WordPress plugins Scenario: Can't install plugin that requires a newer version of WordPress Given a WP install - When I run `wp core download --version=6.4 --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.4 --force` + Then the return code should be 0 And I run `rm -r wp-content/themes/*` And I try `wp plugin install wp-super-cache` diff --git a/features/theme-install.feature b/features/theme-install.feature index b4bd2652..63ba640f 100644 --- a/features/theme-install.feature +++ b/features/theme-install.feature @@ -130,7 +130,9 @@ Feature: Install WordPress themes Scenario: Can't install theme that requires a newer version of WordPress Given a WP install - When I run `wp core download --version=6.4 --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.4 --force` + Then the return code should be 0 And I run `rm -r wp-content/themes/*` And I try `wp theme install twentytwentyfive` From 3409ce39c52722cb21568e1f40a32dc37c1f98bc Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 27 Nov 2026 17:12:40 +0000 Subject: [PATCH 3/4] Quote the custom download paths Keeps the target path a single shell argument if the temporary directory contains a space. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01CE81GsxUY597AdaMP1NXzk --- features/extension-download.feature | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/features/extension-download.feature b/features/extension-download.feature index d202db30..18d0e295 100644 --- a/features/extension-download.feature +++ b/features/extension-download.feature @@ -19,7 +19,7 @@ Feature: Download WordPress.org extensions without loading WordPress Scenario: Downloading a plugin package to a custom path Given an empty directory - When I run `wp plugin download debug-bar --target-path={RUN_DIR}/custom-path` + When I run `wp plugin download debug-bar --target-path="{RUN_DIR}/custom-path"` Then STDOUT should contain: """ Success: Downloaded plugin package to @@ -103,7 +103,7 @@ Feature: Download WordPress.org extensions without loading WordPress Scenario: Downloading a theme package to a custom path Given an empty directory - When I run `wp theme download twentytwelve --target-path={RUN_DIR}/custom-path` + When I run `wp theme download twentytwelve --target-path="{RUN_DIR}/custom-path"` Then STDOUT should contain: """ Success: Downloaded theme package to From 25d7b6506131635a3167a7c74b2587e56a57ed2d Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 27 Nov 2026 17:29:03 +0000 Subject: [PATCH 4/4] Fix Gherkin lint: start a new When block after the return code check Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01CE81GsxUY597AdaMP1NXzk --- features/plugin-install.feature | 2 +- features/theme-install.feature | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/features/plugin-install.feature b/features/plugin-install.feature index 71991b8a..bd880947 100644 --- a/features/plugin-install.feature +++ b/features/plugin-install.feature @@ -295,8 +295,8 @@ Feature: Install WordPress plugins # 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.4 --force` Then the return code should be 0 - And I run `rm -r wp-content/themes/*` + When I run `rm -r wp-content/themes/*` And I try `wp plugin install wp-super-cache` Then STDERR should contain: """ diff --git a/features/theme-install.feature b/features/theme-install.feature index 63ba640f..bf3302cf 100644 --- a/features/theme-install.feature +++ b/features/theme-install.feature @@ -133,8 +133,8 @@ Feature: Install WordPress themes # 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.4 --force` Then the return code should be 0 - And I run `rm -r wp-content/themes/*` + When I run `rm -r wp-content/themes/*` And I try `wp theme install twentytwentyfive` Then STDERR should contain: """