inveniosoftware / inveniosoftware/pytest-invenio
Add invenio-cache (Redis) fixture
- 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
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