Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve CLI commands tests coverage #3202

Merged
merged 8 commits into from
Dec 16, 2022

Conversation

burhandodhy
Copy link
Contributor

@burhandodhy burhandodhy commented Dec 13, 2022

Description of the Change

This PR adds the new tests for the WP CLI commands. With this change, the coverage of commands is reached to 90%. 

I made one change in the put_mapping_helper instead of returning false when the error happens. I update that with WP_CLI::error so it stops the execution as soon as an error occurs. 

Also, this particular line

WP_CLI::error( esc_html__( 'Mapping Failed.', 'elasticpress' ) );
fixes this issue #3198.

Closes #3198 #3054

How to test the Change

Changelog Entry

Added - New test for WP CLI Commands
Fixed - Sync command exits without any error message if mapping fails

Credits

Props @burhandodhy, @felipeelia

Checklist:

  • I agree to follow this project's Code of Conduct.
  • I have updated the documentation accordingly.
  • I have added tests to cover my change.
  • All new and existing tests pass.

@burhandodhy burhandodhy changed the title Chore/improve cli commands tests coverage Improve CLI commands tests coverage Dec 13, 2022
@burhandodhy burhandodhy self-assigned this Dec 13, 2022
@burhandodhy burhandodhy added this to the 4.4.1 milestone Dec 13, 2022
@felipeelia felipeelia merged commit 38a4ad1 into develop Dec 16, 2022
@felipeelia felipeelia deleted the chore/improve-cli-commands-tests-coverage branch December 16, 2022 13:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG: Sync command exits without any error message if mapping fails.
2 participants