Conversation
test workflow test workflow test Add docker tag in workflow description
lint
Hello @mmachatschek!
No need to test the previous version of MeiliSearch for the moment. Since MeiliSearch is not stable, it does not worth it 🙂 Thanks again! |
Remove duplicate underscore
@curquiza this is ready for review. For the actual search queries to MeiliSearch I had to wrap it with a retry function because of a race condition, where meilisearch's index wasn't yet ready for all entries. How was this solved in symfony or other implementations? |
Hello @mmachatschek!
If I understand well you need to be sure the push of documents is ready when you want to search. We provide a function in the meilisearch-php client, which is A usage example: https://github.com/meilisearch/meilisearch-php/blob/6cb37bae30904b0364fc5dc30b71cc41fbc6cac4/tests/Endpoints/SearchTest.php#L17-L19 The implementation of the method if you are curious: https://github.com/meilisearch/meilisearch-php/blob/6cb37bae30904b0364fc5dc30b71cc41fbc6cac4/src/Endpoints/Indexes.php#L116-L137 Sorry it's not documented yet! |
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.
This is the first review, I have not checked the code, I'm waiting for your update with the waitForPendingUpdate
method 👍
Also @mmachatschek you seem really involved in this repo and all the MeiliSearch team wants to thank you! That's why I've just given the write access to you on the repo 🙂 No need to work on your forked repository anymore, and your reviews will be valuable (= take into account as a real reviewer by GitHub). |
I looked into this. It would definitely fix the race condition in the tests. However it would require to mock the feature tests again and hook into the
Thanks @curquiza for that I'll gladly contribute to this and maybe other repos of MeiliSearch 😊 |
Hum I don't understand why we would mock this part 🤔 In all our other repositories we do tests with the |
I can't think of a possibility to get the promiseId of an update/create event returned by the meilisearch-php client. via the laravel-scout library without changing any method signature or mocking/extending anything for the test. Maybe I'm missunderstanding something here 😅 @shokme maybe you have an Idea how to use either |
Hum, I see you have a |
@curquiza I updated the code now. Now we use your suggested method with |
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 have some questions, sorry if there are newbie questions, I have a limited experience with Laravel 🙂
{ | ||
collect(resolve(Client::class)->getAllIndexes())->each(function (Indexes $index) { | ||
// Starts with prefix | ||
if (substr($index->getUid(), 0, strlen($this->getPrefix())) === $this->getPrefix()) { |
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.
What is the purpose of this condition?
I think we should delete all the indexes without any condition.
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 just wanted to make sure that there is no data lost if someone runs the tests with an existing instance. So this just removes the indexes from meilisearch that start with the prefix set in the tests.
tests/Fixtures/database/migrations/0000_00_00_000000_create_searchable_models_table.php
Outdated
Show resolved
Hide resolved
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.
Awesome!! Thank you so much @mmachatschek!!
bors merge
Build succeeded: |
WIP
This adds feature tests to the repo and solves #90 and #81
TODOS:Add documentation how to run feature tests locallySCOUT_PREFIX
config with a test key and only remove indexes with that prefix to avoid deleting documents from a local meilisearch instanceI added a matrix for the meilisearch containers to also test the library against older versions. If this should be removed, just tell me @shokme or @curquiza.