Skip to content
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

Implement the get_or_create_index method #69

Merged
merged 1 commit into from Jul 9, 2020

Conversation

curquiza
Copy link
Member

@curquiza curquiza commented Jul 8, 2020

No description provided.

@curquiza curquiza mentioned this pull request Jul 8, 2020
@curquiza curquiza requested a review from eskombro July 8, 2020 13:09
Copy link
Member

@eskombro eskombro left a comment

Choose a reason for hiding this comment

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

I would add a test calling more than once get_or_create_index, checking that it doesn't create a new one but also doesn't raise an error. Otherwise, it seems perfect!

spec/meilisearch/client/indexes_spec.rb Show resolved Hide resolved
@curquiza
Copy link
Member Author

curquiza commented Jul 9, 2020

@eskombro

I would add a test calling more than once get_or_create_index, checking that it doesn't create a new one but also doesn't raise an error

There's already a test named get an already existing index with get_or_create_index method checking:

  • the UID
  • that the indexes count did not increase
  • there is no error raised (otherwise, the tests suite would stop)

Remember, the tests are not independent between them, there are only dependent on the context. The test I mention follows a previous call of get_or_created_index, so I already call more than once get_or_created_index in the same context.

eskombro
eskombro previously approved these changes Jul 9, 2020
@eskombro
Copy link
Member

eskombro commented Jul 9, 2020

@eskombro

I would add a test calling more than once get_or_create_index, checking that it doesn't create a new one but also doesn't raise an error

There's already a test named get an already existing index with get_or_create_index method checking:

* the UID

* that the indexes count did not increase

* there is no error raised (otherwise, the tests suite would stop)

Remember, the tests are not independent between them, there are only dependent on the context. The test I mention follows a previous call of get_or_created_index, so I already call more than once get_or_created_index in the same context.

You are right, I was reviewing each test as a single entity, didn't think that this was indeed tested anyways. I would still add it to make it an explicit test, because they can evolve and we won't necessarily think of this while modifying it, but it is indeed tested and not really urgent!

@curquiza
Copy link
Member Author

curquiza commented Jul 9, 2020

Since all of our tests are not independent, it is not really useful to make this test specifically dependent and not the others (like gets list of indexes or shows a specific index...).
But we should indeed think about a re-do of our tests suite to make our tests independent, as a contributor did for the PHP package.

@curquiza curquiza merged commit 746c191 into master Jul 9, 2020
@curquiza curquiza deleted the implement-get-or-create-index branch July 9, 2020 15:34
@eskombro eskombro linked an issue Jul 13, 2020 that may be closed by this pull request
bidoubiwa pushed a commit that referenced this pull request Mar 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

get_or_create_index method
2 participants