Disable features without required Redis modules

Some features, like querying and embedded models, require
either the RediSearch or RedisJSON modules running in Redis.
Without these modules, using these features would result
in inscrutable errors.

We now disable some tests if the Redis module required for the
test is not found in the Redis instance the tests are using,
and raise errors or log messages if the same is true during
execution of HashModel and JsonModel.
This commit is contained in:
Andrew Brookins 2021-11-03 12:37:09 -07:00
parent ca48b222f3
commit 2b1994b98b
8 changed files with 269 additions and 10 deletions

View file

@ -56,6 +56,14 @@ format: $(INSTALL_STAMP)
test: $(INSTALL_STAMP)
$(POETRY) run pytest -n auto -s -vv ./tests/ --cov-report term-missing --cov $(NAME)
.PHONY: test_oss
test_oss: $(INSTALL_STAMP)
# Specifically tests against a local OSS Redis instance via
# docker-compose.yml. Do not use this for CI testing, where we should
# instead have a matrix of Docker images.
REDIS_OM_URL="redis://localhost:6381" $(POETRY) run pytest -n auto -s -vv ./tests/ --cov-report term-missing --cov $(NAME)
.PHONY: shell
shell: $(INSTALL_STAMP)
$(POETRY) shell