-
Notifications
You must be signed in to change notification settings - Fork 313
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
Add Health Check Elasticsearch tests #3213
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work on this one @burhandodhy. I left a couple of comments, do you mind taking a look? Thanks!
|
||
$response = json_decode( $this->_last_response, true ); | ||
|
||
$this->assertEquals( true, $response['success'] ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we change this to
$this->assertEquals( true, $response['success'] ); | |
$this->assertTrue( $response['success'] ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
|
||
remove_filter( 'ep_host', '__return_empty_string' ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the test suite removes all filters in the end of each test execution (at least WP core does.) Do you mind testing if we really need to remove it @burhandodhy?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The tests are working fine without removing the filters. Most of the tests involve removing the filters at the end. Do you mind if I remove remove_filters
from all tests in a separate PR?
Description of the Change
This PR adds the unit tests for the
HealthCheckElasticsearch
https://github.com/10up/ElasticPress/blob/4.4.0/includes/classes/HealthCheck/HealthCheckElasticsearch.phpCloses #3054
How to test the Change
Changelog Entry
Credits
Props @burhandodhy
Checklist: