RediSearch / redisearch-py

RediSearch python client
https://redisearch.io
BSD 2-Clause "Simplified" License
221 stars 62 forks source link

Faking redisearch-py? (mocking) #104

Open kingbuzzman opened 3 years ago

kingbuzzman commented 3 years ago

We have a pretty complicated setup currently, and to speed up our tests we would like to mock redis + redisearch. Do you know of any preexisting library that does it? We looked into fakeredis, issue is that all of the FT.* commands fail. I've reached out to the maintainer to see if he'd be interested in hosting the project there if there is no current alternative.

ashtul commented 3 years ago

@kingbuzzman - what are you trying to mock? You can use FT.EXPLAIN to check that your FT.SEARCH and FT.AGGREGATE commands do not have any syntactic errors.

kingbuzzman commented 3 years ago

We're looking to make a fake redis server + redisearch to be able to run all our tests and most importantly run them in parallel and not have them interfere with one another.

Another valid option is to spawn a couple of redis server + redisearch module attach them to individual tests and run them in parallel, then turn them off when done.

gkorland commented 3 years ago

You don't have to create a different server for each test, you can also create a different index for each test.