From 4555e44e7da74b9b9da963dcf1a36eafa247a04a Mon Sep 17 00:00:00 2001 From: Pascal Birchler Date: Wed, 18 Nov 2026 04:39:07 +0000 Subject: [PATCH] Skip fork-dependent scenarios without pcntl and test the fallback Scenarios that check for a shared worker or for WordPress reloading need the pcntl extension, which the Docker images the tests run in lacked. Tag them so they are skipped where it is missing, and add a scenario for the fallback to separate processes. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01UWTd5oZXFWfL1mxtssHXwz --- features/batch-run.feature | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/features/batch-run.feature b/features/batch-run.feature index c146b1d..fb0eeb0 100644 --- a/features/batch-run.feature +++ b/features/batch-run.feature @@ -38,6 +38,7 @@ Feature: Run a batch of WP-CLI commands WP CLI Site """ + @require-extension-pcntl Scenario: Commands see changes made by earlier commands Given a WP install And a commands.txt file: @@ -79,6 +80,7 @@ Feature: Run a batch of WP-CLI commands Error: 1 of 7 commands failed. """ + @require-extension-pcntl Scenario: Commands that change nothing WordPress loads share a worker Given a WP install And a commands.txt file: @@ -268,6 +270,27 @@ Feature: Run a batch of WP-CLI commands Success: Ran 2 commands. """ + Scenario: Fall back to separate processes when forking is not possible + Given a WP install + And a commands.txt file: + """ + option update blogname "Batch Site" + option get blogname + """ + + When I try `WP_CLI_PHP_ARGS='-d disable_functions=pcntl_fork' wp batch run commands.txt` + Then the return code should be 0 + And STDERR should be: + """ + Warning: The pcntl extension is not available, so each command runs in its own process. + """ + And STDOUT should be: + """ + Success: Updated 'blogname' option. + Batch Site + Success: Ran 2 commands. + """ + Scenario: Invalid input Given an empty directory