redisearch-py icon indicating copy to clipboard operation
redisearch-py copied to clipboard

Faking redisearch-py? (mocking)

Open kingbuzzman opened this issue 3 years ago • 3 comments

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.

kingbuzzman avatar Nov 02 '20 22:11 kingbuzzman

@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.

ashtul avatar Nov 03 '20 04:11 ashtul

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.

kingbuzzman avatar Nov 03 '20 17:11 kingbuzzman

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

gkorland avatar Nov 05 '20 23:11 gkorland