Skip to content
Merged
Changes from all commits
Commits
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
23 changes: 23 additions & 0 deletions features/batch-run.feature
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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

Expand Down
Loading