Skip to content

Commit

Permalink
Merge pull request #1222 from supercaracal/fix-cluster
Browse files Browse the repository at this point in the history
Fix redis-clustering gem to pass the test with latest dependencies
  • Loading branch information
byroot committed Sep 13, 2023
2 parents 1f37095 + ea4d04a commit 01de51a
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yaml
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
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
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
1 change: 0 additions & 1 deletion cluster/test/commands_on_keys_test.rb
Expand Up @@ -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')
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
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 01de51a

Please sign in to comment.