Skip to content

Commit

Permalink
Fix redis-clustering gem to pass the test with latest dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
supercaracal committed Sep 13, 2023
1 parent 1f37095 commit 9cb7583
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ jobs:
env:
TIMEOUT: "15"
LOW_TIMEOUT: "0.14"
REDIS_BRANCH: "7.0"
REDIS_BRANCH: "7.2"
BUNDLE_GEMFILE: cluster/Gemfile
steps:
- name: Check out code
Expand Down
4 changes: 2 additions & 2 deletions cluster/lib/redis/cluster/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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(' ')
end

def server_url
@router.node.node_keys
@router.node_keys
end

def connected?
Expand Down
2 changes: 1 addition & 1 deletion cluster/redis-clustering.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -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')
end
2 changes: 1 addition & 1 deletion cluster/test/commands_on_keys_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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')
assert(redis.object('idletime', 'mylist') >= 0)

redis.set('foo', 1000)
Expand Down
8 changes: 2 additions & 6 deletions cluster/test/commands_on_server_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,8 @@ def test_client_kill

def test_client_list
a_client_info = redis.client(:list).first
actual = a_client_info.keys.sort
expected = %w[addr age cmd db events fd flags id idle multi name obl oll omem psub qbuf qbuf-free sub]
expected << 'user' << 'argv-mem' << 'tot-mem' if version >= '6'
expected << 'laddr' << 'redir' if version >= '6.2'
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'
end

def test_client_getname
Expand Down

0 comments on commit 9cb7583

Please sign in to comment.