Skip to content

Run Redis backed unit tests 1:1 against real Redis#107

Draft
niksy wants to merge 8 commits into
flyingsquirrel0419:mainfrom
niksy:test/real-redis-mirror
Draft

Run Redis backed unit tests 1:1 against real Redis#107
niksy wants to merge 8 commits into
flyingsquirrel0419:mainfrom
niksy:test/real-redis-mirror

Conversation

@niksy

@niksy niksy commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Description

This PR aligns Redis backend unit tests against real Redis so we can test full Redis layer functionality with real Redis client while also preserving mock test. Duplicate tests are removed and only real integration tests are preserved.

Vitest mocking is replaced by Redis client factory. Factory decides which client should be used based on evironment variable.

Integration tests configuration has been simplified to use (Vitest globalSetup is used for setting up Docker environment). Also, I’ve moved them to default tests but guarded them with real Redis flag usage.

I also think that we should completely remove ioredis mock and just use real Redis. There is no benefit in mocking if we can achieve real Redis usage test with our current Docker setup.

This PR is also dependant on #104 so that one should be merged first.

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing behavior to change)
  • Refactor (no functional change, code improvement)
  • Documentation update
  • Test coverage improvement

Testing

  • All existing tests pass (npm test)
  • New tests added for the changes
  • Lint passes (npm run lint)
  • Build succeeds (npm run build:all)

Checklist

  • My changes follow the existing code style (single quotes, no semicolons, 2-space indent)
  • I have updated documentation where applicable
  • I have added tests that prove my fix/feature works
  • No type errors suppressed (as any, @ts-ignore, @ts-expect-error)

Additional Notes

@coderabbitai

coderabbitai Bot commented Jul 16, 2026

Copy link
Copy Markdown

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 41d6d27e-3bea-4629-8818-db09e9cc02ae

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@flyingsquirrel0419

Copy link
Copy Markdown
Owner

Is it done? @niksy

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