Skip to content

Conversation

@ppamorim
Copy link
Contributor

@ppamorim ppamorim commented Oct 4, 2020

Summary

Reasons why the tests are failing

On the test testGetDistinctAttribute and testUpdateDistinctAttribute:

- The attribute that returns from the server contains a double "", causing the error: XCTAssertEqual failed: ("product_id") is not equal to (""product_id"")

On the test testGetSettings and testUpdateSettings:

- Probably due to the acceptNewFields, this has been removed.

@ppamorim ppamorim added enhancement New feature or request Hacktoberfest labels Oct 4, 2020
@ppamorim ppamorim self-assigned this Oct 4, 2020
@ppamorim ppamorim linked an issue Oct 4, 2020 that may be closed by this pull request
24 tasks
@ppamorim
Copy link
Contributor Author

ppamorim commented Oct 5, 2020

@curquiza Please review the tests, I am not sure what to do with the failed tests. Please bear that this PR is still a draft.

@ppamorim ppamorim linked an issue Oct 5, 2020 that may be closed by this pull request
@ppamorim ppamorim requested a review from curquiza October 5, 2020 12:22
@ppamorim
Copy link
Contributor Author

ppamorim commented Oct 5, 2020

@curquiza Waiting for the merge of #51 This will sort the settings test failure. I will rebase everything before merging this PR.

@ppamorim ppamorim force-pushed the feature/integrationTest branch 3 times, most recently from d831059 to f5b7391 Compare October 5, 2020 13:54
@curquiza
Copy link
Member

curquiza commented Oct 5, 2020

Hello @ppamorim! Thanks for this awesome PR!
The #51 is removed!

You can now rebase your branch 🙂

@ppamorim ppamorim force-pushed the feature/integrationTest branch from f5b7391 to ec7254e Compare October 5, 2020 13:56
@ppamorim
Copy link
Contributor Author

ppamorim commented Oct 5, 2020

@curquiza Just did this.

@curquiza
Copy link
Member

curquiza commented Oct 5, 2020

awesome @ppamorim. If your PR is ready for review, can you remove the draft status of this PR? 🙂
We will review it asap!

@curquiza curquiza requested a review from bidoubiwa October 5, 2020 14:00
@ppamorim ppamorim linked an issue Oct 5, 2020 that may be closed by this pull request
@ppamorim ppamorim marked this pull request as ready for review October 5, 2020 17:30
@ppamorim ppamorim force-pushed the feature/integrationTest branch 2 times, most recently from 1830852 to d5afa00 Compare October 5, 2020 17:33
@ppamorim
Copy link
Contributor Author

ppamorim commented Oct 5, 2020

Waiting for PR #30 to be rebased and merged. This is needed to correct some failing tests in the search route.

@ppamorim ppamorim linked an issue Oct 5, 2020 that may be closed by this pull request
2 tasks
@ppamorim ppamorim linked an issue Oct 5, 2020 that may be closed by this pull request
@ppamorim ppamorim force-pushed the feature/integrationTest branch from 440f5f0 to c799343 Compare October 5, 2020 21:11
@ppamorim ppamorim force-pushed the feature/integrationTest branch from 70a6f6b to 9661172 Compare October 6, 2020 12:19
@ppamorim
Copy link
Contributor Author

ppamorim commented Oct 6, 2020

@curquiza Sorry I had to rebase it since Github informed that it was out of sync with the master.

@curquiza
Copy link
Member

curquiza commented Oct 6, 2020

@curquiza Sorry I had to rebase it since Github informed that it was out of sync with the master.

Yes, GitHub will inform you, but Bors will do the rebase at your place before merging 🙂 (except if you have merge conflicts. In this case you would have to rebase yourself)
So no worries about this GitHub warning.

@ppamorim
Copy link
Contributor Author

ppamorim commented Oct 6, 2020

@curquiza @bidoubiwa Just waiting for the review now. :)

Copy link
Member

@curquiza curquiza left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello @ppamorim!
Huge work!

This is the review part I 😁 I will review the test files tomorrow!

One change asked 😇

  • [ ] If I'm not wrong, there is no test about the facetsDistribution of SearchResult. I mean, doing a test with facetsDistribution as a search parameter and check that the facetsDistribution in the serach *result are accessible. See the issue requirement (#58).

public func encode(to encoder: Encoder) throws {
var container = encoder.container(keyedBy: CodingKeys.self)
try container.encode(query, forKey: .query)
if limit != 20 {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why should we need to do a condition with the default value?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a filter to default parameters, so far I know these values are fixed in the server and if they are not informed in the HTTP request the server will apply the default ones, am I correct?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The API is based in this documentation: https://docs.meilisearch.com/references/search.html#search-in-an-index-with-post-route

Note how the first example only contains the query item as mandatory, all other options are optional. This script remove the need of informing the default values.

Copy link
Member

@curquiza curquiza Oct 7, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But what is the point of doing this?

if they are not informed in the HTTP request the server will apply the default ones,

Yes, exactly, so no need to check the default value. Just send to MeiliSearch what the users fill, we don't care if they fill default values. MeiliSearch will manage that.

This big if conditions are really complex for a job that MeiliSearch already does.

Or maybe I missed something!

@curquiza curquiza removed a link to an issue Oct 6, 2020
@ppamorim
Copy link
Contributor Author

ppamorim commented Oct 6, 2020

Hello @ppamorim!
Huge work!

This is the review part I 😁 I will review the test files tomorrow!

One change asked 😇

  • If I'm not wrong, there is no test about the facetsDistribution of SearchResult. I mean, doing a test with facetsDistribution as a search parameter and check that the facetsDistribution in the serach *result are accessible. See the issue requirement (facetsDistribution is missing in SearchResult model #58).

There is a test related to this, it's named testSearchFacetsDistribution. It checks for the genres of books and compares the dictionary that returns from Meilisearch.

@ppamorim ppamorim force-pushed the feature/integrationTest branch from c199a7c to c06f6fd Compare October 6, 2020 21:38
@curquiza
Copy link
Member

curquiza commented Oct 7, 2020

There is a test related to this, it's named testSearchFacetsDistribution. It checks for the genres of books and compares the dictionary that returns from Meilisearch.

My bad! I've seen it!

@ppamorim ppamorim requested a review from curquiza October 7, 2020 19:53
@ppamorim ppamorim mentioned this pull request Oct 7, 2020
Copy link
Member

@curquiza curquiza left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review part II

You did a so HUGE work on the tests!!!! We all know here how it's a painful job to write tests and you created a lot! Thanks for that 🙂

Some remarks:

  • still the questioning here (#54 (comment)) from my previous review
  • I remark, for the Settings tests , for the get methods, you use the update method. For me, it's a little bit redundant with the update test right after: you can only check the default value of the settings.
    But, as it's not really mandatory and just a detail, I'm going to open a PR to your branch to suggest changes so that it avoids you another painful work, just let me the day 😉

ppamorim and others added 4 commits October 8, 2020 10:24
* Add forgotten tests

* Simplify GET tests for Settings

* Add attribtuesForFaceting in tests

* Simplify UPDATE tests for Settings

* Rename wrong variables
Copy link
Member

@curquiza curquiza left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR is finally ready for a merge :)

Two points could be improved from my POV:

  • the behemot (see #54 (comment)): I'm going to open an issue
  • the if condition (see #54 (comment)). I'm going to open a PR with an improvement suggestion in the next few days.

Thanks again @ppamorim!

@curquiza
Copy link
Member

curquiza commented Oct 8, 2020

bors try

bors bot added a commit that referenced this pull request Oct 8, 2020
@bors
Copy link
Contributor

bors bot commented Oct 8, 2020

try

Build succeeded:

@curquiza
Copy link
Member

curquiza commented Oct 8, 2020

bors merge

@bors
Copy link
Contributor

bors bot commented Oct 8, 2020

Build succeeded:

@bors bors bot merged commit 06c8527 into master Oct 8, 2020
@bors bors bot deleted the feature/integrationTest branch October 8, 2020 15:34
@curquiza curquiza added skip-changelog The PR will not appear in the release changelogs and removed enhancement New feature or request labels Oct 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip-changelog The PR will not appear in the release changelogs

Projects

None yet

4 participants