Skip to content

Commit

Permalink
Merge pull request #140 from wp-cli/fix/mark-oom-catch-test-broken
Browse files Browse the repository at this point in the history
Remove duplicate test and mark remaining as broken
  • Loading branch information
schlessera authored May 12, 2021
2 parents b7f3d24 + 68ecf86 commit 031c54b
Showing 1 changed file with 1 addition and 40 deletions.
41 changes: 1 addition & 40 deletions features/package.feature
Original file line number Diff line number Diff line change
Expand Up @@ -57,46 +57,7 @@ Feature: Manage WP-CLI packages
When I run `wp --require=bad-command.php package list`
Then STDERR should be empty

@require-php-7.2
Scenario: Revert the WP-CLI packages composer.json when fail to install/uninstall a package due to memory limit
Given an empty directory
When I try `{INVOKE_WP_CLI_WITH_PHP_ARGS--dmemory_limit=10M -ddisable_functions=ini_set} package install danielbachhuber/wp-cli-reset-post-date-command`
Then the return code should not be 0
And STDERR should contain:
"""
Reverted composer.json.
"""

When I run `wp package install danielbachhuber/wp-cli-reset-post-date-command`
Then STDOUT should contain:
"""
Success: Package installed.
"""

When I try `{INVOKE_WP_CLI_WITH_PHP_ARGS--dmemory_limit=10M -ddisable_functions=ini_set} package uninstall danielbachhuber/wp-cli-reset-post-date-command`
Then the return code should not be 0
And STDERR should contain:
"""
Reverted composer.json.
"""

# Create a default composer.json first to compare.
When I run `WP_CLI_PACKAGES_DIR={RUN_DIR}/mypackages wp package list`
Then the {RUN_DIR}/mypackages/composer.json file should exist
And save the {RUN_DIR}/mypackages/composer.json file as {MYPACKAGES_COMPOSER_JSON}

When I try `WP_CLI_PACKAGES_DIR={RUN_DIR}/mypackages {INVOKE_WP_CLI_WITH_PHP_ARGS--dmemory_limit=10M -ddisable_functions=ini_set} package install danielbachhuber/wp-cli-reset-post-date-command`
Then the return code should not be 0
And STDERR should contain:
"""
Reverted composer.json.
"""
And the mypackages/composer.json file should be:
"""
{MYPACKAGES_COMPOSER_JSON}
"""

@require-php-7.2
@require-php-7.2 @broken
Scenario: Revert the WP-CLI packages composer.json when fail to install/uninstall a package due to memory limit
Given an empty directory
When I try `{INVOKE_WP_CLI_WITH_PHP_ARGS--dmemory_limit=10M -ddisable_functions=ini_set} package install danielbachhuber/wp-cli-reset-post-date-command`
Expand Down

0 comments on commit 031c54b

Please sign in to comment.