inveniosoftware / inveniosoftware/pytest-invenio

Add invenio-cache (Redis) fixture

Open
#30 2 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Python
Stars
5
Forks
28
PR merge metrics
No merged PRs in 30d

Description

It would be useful to have `invenio-cache` (or Redis) fixtures to be able to:

- [x] Clear all keys with pefix [`CACHE_KEY_REFIX`](https://github.com/inveniosoftware/invenio-cache/blob/2f0e1c8f9b1cf2b2dfb338d82b77f6287a367a74/invenio_cache/config.py#L19)
- [x] Clear the entire Redis instance (e.g. with `FLUSHALL`)

Another interesting alternative is specifying a custom `CACHE_KEY_PREFIX` for testing (e.g. `'tests::cache::'`) and clear only this one.

Contributor guide

Open the contributing guide

Research direction

Start by locating the existing pytest-invenio fixture definitions and checking how invenio-cache or Redis is configured in tests. Compare the proposed key-prefix cleanup with FLUSHALL, then add a fixture whose behavior is covered for clearing the intended cache state.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, redis
Domain
testing
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.