-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Fix redis-clustering gem to pass the test with latest dependencies #1222
Conversation
@@ -28,11 +28,11 @@ def initialize(*) | |||
ruby2_keywords :initialize if respond_to?(:ruby2_keywords, true) | |||
|
|||
def id | |||
@router.node.node_keys.join(' ') | |||
@router.node_keys.join(' ') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -47,5 +47,5 @@ Gem::Specification.new do |s| | |||
s.required_ruby_version = '>= 2.7.0' | |||
|
|||
s.add_runtime_dependency('redis', s.version) | |||
s.add_runtime_dependency('redis-cluster-client', '>= 0.3.7') | |||
s.add_runtime_dependency('redis-cluster-client', '>= 0.6.1') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -47,7 +47,7 @@ def test_migrate | |||
def test_object | |||
redis.lpush('mylist', 'Hello World') | |||
assert_equal 1, redis.object('refcount', 'mylist') | |||
assert_equal 'quicklist', redis.object('encoding', 'mylist') | |||
assert_equal 'listpack', redis.object('encoding', 'mylist') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like internal changes for Redis 7.2.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it's best to either remove that test or to allow both values.
There is no point testing Redis internal implementation.
expected << "multi-mem" << "rbp" << "rbs" << "resp" << "ssub" if version >= '7.0' | ||
assert_equal expected.sort, actual.sort | ||
assert_instance_of Hash, a_client_info | ||
assert_includes a_client_info, 'addr' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- It looks like server side changes for reply type from Array to Hash.
- I simplified this test case rather than meticulous assertion because it is weak against server side minor changes.
9cb7583
to
ea4d04a
Compare
@@ -47,7 +47,6 @@ def test_migrate | |||
def test_object | |||
redis.lpush('mylist', 'Hello World') | |||
assert_equal 1, redis.object('refcount', 'mylist') | |||
assert_equal 'quicklist', redis.object('encoding', 'mylist') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was changed to 'listpack' in Redis 7.2. We have no advantages for testing redis minor behavior, so just removed.
The CI job was failed but it was related to sentinel.
|
0.6.1
, redis-rb should adapt codes depended on it.