Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat [ Test ]: migrate from redis-mock to redis testcontainer for tests #336

Merged
merged 6 commits into from
Dec 25, 2024

Conversation

e11sy
Copy link
Contributor

@e11sy e11sy commented Dec 25, 2024

Since #326 we decided to set up redis testcontainer for tests instead of redis-mock lib
Also we needed to use new version of redis package (from 3.1.1 -> 4.7.0)

Problem

  • Since we removed redis-mock we need to rewrite tests to new pattern
  • Since we use new redis version we need to rewrite some of the redisClient calls
  • Also we should use new redesClient calls in tests

Solution

  • Set up redis testcontainer for tests
  • Refactored Limiter and Grouper workers for them to be compatible with new redis version
  • Refactored their tests
  • Added initialize() and close() methods for RedisHelpers (now they are initialized and closed same as db in worker.start() and worker.finish())
  • Now "redis": "^4.7.0" is root worker dependencie (since same version is used for tests)

@neSpecc neSpecc merged commit 4d1973c into master Dec 25, 2024
3 checks passed
@neSpecc neSpecc deleted the setup-redis-testcontainer branch December 25, 2024 17:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants