Skip to content
This repository has been archived by the owner on May 13, 2021. It is now read-only.

Add not mocked tests #90

Closed
curquiza opened this issue Feb 1, 2021 · 4 comments
Closed

Add not mocked tests #90

curquiza opened this issue Feb 1, 2021 · 4 comments

Comments

@curquiza
Copy link
Member

curquiza commented Feb 1, 2021

Hello everyone!

The current mock of the MeiliSearch server makes me a little worried about our tests. I would rather have tests running against a real MeiliSearch server. The goal is to be sure this package works in production against the latest version of MeiliSearch.
Indeed, MeiliSearch and meilisearch-php are not stable yet, and each modification in the MeiliSearch server enforces us to update the mock. Otherwise, our tests are not up to date with the last modifications of MeiliSearch and our package could contain errors without noticing them.

I don't say we should remove the mocked part, but we should at least have the integration test part against a real MeiliSearch server, so why not keep both? Except if you think this is too much maintenance, let's remove the mock part then.

We've done the same in the Symfony bundler package: https://github.com/meilisearch/meilisearch-symfony/blob/c764bcdb45f83941bc10d3b461ded5cf8d7f86b7/.github/workflows/tests.yml#L29-L32
And in the meilisearch-php SDK repo: https://github.com/meilisearch/meilisearch-php/blob/master/.github/workflows/tests.yml

What do you think @shokme? (just your opinion, I'm not asking you if you have time to do it of course 😁)
And also everyone, what is your opinion on it?

@curquiza curquiza added the question Further information is requested label Feb 1, 2021
@curquiza curquiza added this to Open issues in SDKs & Integrations via automation Feb 1, 2021
@curquiza curquiza mentioned this issue Feb 1, 2021
@mmachatschek
Copy link
Collaborator

I'm totally on your side on this @curquiza. Adding the meilisearch service in the CI tests would be a great addition.

At the same point we could split the tests to a structure like Unit tests and Feature tests. And let the current mocked tests live along.

My changes in #89 added the test coverage output which shows the parts that are untested at the moment. That part could be the start of the new Feature tests

@curquiza
Copy link
Member Author

curquiza commented Feb 2, 2021

Ok, then let's do this! This would make our repo safer 💪

@curquiza curquiza changed the title Mocking in our tests Add not mocked tests Feb 2, 2021
@curquiza curquiza removed the question Further information is requested label Feb 2, 2021
@mmachatschek mmachatschek mentioned this issue Feb 14, 2021
3 tasks
bors bot added a commit that referenced this issue Mar 2, 2021
102: Add feature tests r=curquiza a=mmachatschek

WIP

This adds feature tests to the repo and solves #90 and #81

~~TODOS:~~

- [x] ~~Add documentation how to run feature tests locally~~
- [x] Add more tests (based on https://github.com/meilisearch/meilisearch-symfony/)
- [x] Update the cleanup method and add a `SCOUT_PREFIX` config with a test key and only remove indexes with that prefix to avoid deleting documents from a local meilisearch instance


~~I 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.~~

Co-authored-by: Markus Machatschek <mmachatschek@yahoo.com>
@mmachatschek
Copy link
Collaborator

@curquiza can this be closed? what do you think

@curquiza
Copy link
Member Author

Yes sorry, the PR should have closed it automatically! 😇

SDKs & Integrations automation moved this from Open issues to Done Mar 18, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
No open projects
Development

No branches or pull requests

2 participants