-
Notifications
You must be signed in to change notification settings - Fork 100
Refactored test suite to make sure the tests are running isolated #19
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
Refactored test suite to make sure the tests are running isolated #19
Conversation
…til.php move deleteAllIndexes method inside the client class and get rid of util.php
Related to #23 |
974935a
to
47e605c
Compare
I think the PR is ready to review. Please let me know what you think. I have some other refactorings in mind, but it would require changes in the |
Add script for tests to increase FDs limit
a368133
to
67adb2f
Compare
Co-Authored-By: Clémentine Urquizar <clementine@meilisearch.com>
56a34f3
to
8e3de7e
Compare
Related to this issue. |
Is it possible to add two tests in search ? Test 1{
limit: 5,
offset: 0,
attributesToRetrieve: ['id', 'title'],
attributesToCrop: ['id', 'title'],
cropLength: 6,
attributesToHighlight: ['id', 'title'],
filters: 'title = "Le Petit Prince"',
matches: true,
} You should have these keys $this->assertArrayHasKey('_matchesInfo', $response["hits"][0]);
$this->assertArrayHasKey('title', $response["hits"][0]['_matchesInfo']);
$this->assertArrayHasKey('_formatted', $response["hits"][0]); But not these keys: $this->assertArrayNotHasKey('comment', $response["hits"][0]);
$this->assertArrayNotHasKey('comment', $response["hits"][0]['_matchesInfo']); Try those value $this->assertSame('Petit <em>Prince</em>', $response["hits"][0]["_formatted"]["title"]); test 2{
limit: 5,
offset: 0,
attributesToRetrieve: "*",
attributesToCrop: "*",
cropLength: 6,
attributesToHighlight: "*",
filters: 'title = "Le Petit Prince"',
matches: true,
} You should have these keys $this->assertArrayHasKey('_matchesInfo', $response["hits"][0]);
$this->assertArrayHasKey('_formatted', $response["hits"][0]);
$this->assertArrayHasKey('comment', $response["hits"][0])
$this->assertArrayHasKey('comment', $response["hits"][0]["_formatted"])
$this->assertArrayHasKey('title', $response["hits"][0]['_formatted']);
$this->assertArrayHasKey('title', $response["hits"][0]['_matchesInfo']);
$this->assertArrayHasKey('comment', $response["hits"][0]['_matchesInfo']) Try those value $this->assertSame('Petit <em>Prince</em>', $response["hits"][0]["_formatted"]["title"]); Tests could be improved but this assure us that the strings are handled correctly! |
…n accordance with meili core
…d card *) based options while searching
3bbbd00
to
96c6c2c
Compare
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 added tests! Thanks a lot
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.
🎉
Need rebasing, and we are finally done @ppshobi 🙂 🎉 |
…ases-and-refactorings-to-test-suite
Done 👍 |
Perfeeeeeeect 👌 Thanks again @ppshobi! |
Hi, This is obviously a big pull request. Please take time to review it especially because this is the test suite. But I have made changes in small chunks so that the review process will be easier. That is also the reason you can see a big commit list.
I will give you an idea about the changes I have done in this PR.
constructor()
andsetup()
methods as necessary and isolated each test methods to be run independently of each other. Then made sure the entire test class passes and then the whole suite. Then move on to the next class.