- First commit to issue fork.
- 🇸🇮Slovenia DeaOm
The namespace in the test file was incorrect so test could not be run, as the error of not finding the class was thrown. After correcting the namespace the tests were successfully run and all of them passed. Because of that change, leaving it to needs review, but I think it can get merged.
- Status changed to Needs work
over 1 year ago 2:53pm 7 August 2023 - 🇸🇮Slovenia bcizej
I went through the code again and they don't really make much sense to me. We are mocking the responses of services and asserting that responses are equal to mocked responses.
An example from here: https://git.drupalcode.org/project/search_api_meilisearch/-/merge_reques...
$this->mockClient->method('getIndex')->willReturn($this->mockIndexes); $this->mockIndexes->method('search')->willReturn($results_data); $results = $meilisearch_api_service->search('movies', 'DieHard', ['limit' => 10]); $this->assertEquals($results_data, $results);
We are saying that the search method will return a mocked data, calling that search method and asserting that the result is equal to the mocked data, so the test is useless.
I think it's better to add a real meilisearch docker container behind the tests and make real calls to meilisearch https://www.meilisearch.com/docs/learn/cookbooks/docker. This way we could test everything from auth, indexes, fields, search etc.
This should be possible by adding a drupalci.yml file in a module root folder https://www.drupal.org/drupalorg/docs/drupal-ci/customizing-drupalci-tes... → .
I'm setting this back to needs work.
- last update
over 1 year ago run-tests.sh fatal error - last update
over 1 year ago run-tests.sh fatal error - last update
over 1 year ago 24 pass, 2 fail - last update
over 1 year ago 24 pass, 2 fail - last update
over 1 year ago 29 pass - 🇸🇮Slovenia bcizej
I've added a custom drupalci.yml with meilisearch docker container attached and a connection test as a basic reference for other tests.
- last update
over 1 year ago 29 pass - last update
over 1 year ago 26 pass - last update
over 1 year ago 26 pass - Status changed to Needs review
over 1 year ago 12:34pm 14 August 2023 - 🇸🇮Slovenia bcizej
I've moved initial tests done by @rokzabukovec to separate classes and they use a meilisearch instance. We are still missing a lot of test scenarios however I think it would be better to merge this and then open new issues to add specific tests. Also existing issues would benefit from having this issue merged so tests can also be added based on this code. So I am changing this to Needs review.
- Status changed to RTBC
about 1 year ago 10:23am 18 August 2023 - 🇸🇮Slovenia DeaOm
The tests are passing and as mentioned some tests are missing and I agree with the: "Also existing issues would benefit from having this issue merged so tests can also be added based on this code" so marking it as RTBC.
-
bcizej →
committed b873afc6 on 1.0.x authored by
rokzabukovec →
Issue #3188421 by rokzabukovec, bcizej, gombi, DeaOm: Providing tests
-
bcizej →
committed b873afc6 on 1.0.x authored by
rokzabukovec →
- Status changed to Fixed
about 1 year ago 10:45am 18 August 2023 Automatically closed - issue fixed for 2 weeks with no activity.