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

Default Redis database always included #17

Open
karlhe opened this issue Feb 1, 2025 · 0 comments
Open

Default Redis database always included #17

karlhe opened this issue Feb 1, 2025 · 0 comments

Comments

@karlhe
Copy link

karlhe commented Feb 1, 2025

I have DatabaseCleaner configured with multiple Redis databases, something like the following:.

DatabaseCleaner[:redis, db: Redis.new(url: "rediss://localhost:6379/1", ssl_params: { verify_mode: OpenSSL::SSL::VERIFY_NONE })].strategy = :deletion
DatabaseCleaner[:redis, db: Redis.new(url: "rediss://localhost:6379/2", ssl_params: { verify_mode: OpenSSL::SSL::VERIFY_NONE })].strategy = :deletion
DatabaseCleaner[:redis, db: Redis.new(url: "rediss://localhost:6379/3", ssl_params: { verify_mode: OpenSSL::SSL::VERIFY_NONE })].strategy = :deletion
DatabaseCleaner[:redis, db: Redis.new(url: "rediss://localhost:6379/4", ssl_params: { verify_mode: OpenSSL::SSL::VERIFY_NONE })].strategy = :deletion

The problem is that it still cleans the default Redis database despite me configuring it.

As a workaround, doing the following seems to remove this behavior:

DatabaseCleaner[:redis].strategy = nil

But I think it doesn't make sense to do this if any other Redis cleaner is configured. Or at least this behavior should be documented if intentional.

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

No branches or pull requests

1 participant