Skip to content

Commit 320e494

Browse files
committed
Test against Redis 6
1 parent aebc693 commit 320e494

File tree

4 files changed

+22
-6
lines changed

4 files changed

+22
-6
lines changed

.travis.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ env:
2727
- TIMEOUT=30
2828
- LOW_TIMEOUT=0.01
2929
matrix:
30-
- DRIVER=ruby REDIS_BRANCH=5.0
31-
- DRIVER=hiredis REDIS_BRANCH=5.0
32-
- DRIVER=synchrony REDIS_BRANCH=5.0
30+
- DRIVER=ruby REDIS_BRANCH=6.0
31+
- DRIVER=hiredis REDIS_BRANCH=6.0
32+
- DRIVER=synchrony REDIS_BRANCH=6.0
3333

3434
matrix:
3535
exclude:
@@ -43,6 +43,8 @@ matrix:
4343
env: DRIVER=ruby REDIS_BRANCH=3.2
4444
- rvm: "2.3"
4545
env: DRIVER=ruby REDIS_BRANCH=4.0
46+
- rvm: "2.3"
47+
env: DRIVER=ruby REDIS_BRANCH=5.0
4648

4749
notifications:
4850
irc:

makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
REDIS_BRANCH ?= 5.0
1+
REDIS_BRANCH ?= 6.0
22
TMP := tmp
33
BUILD_DIR := ${TMP}/cache/redis-${REDIS_BRANCH}
44
TARBALL := ${TMP}/redis-${REDIS_BRANCH}.tar.gz
@@ -34,7 +34,7 @@ ${TMP}:
3434
${BINARY}: ${TMP}
3535
@bin/build ${REDIS_BRANCH} $<
3636

37-
test:
37+
test:
3838
@env SOCKET_PATH=${SOCKET_PATH} bundle exec rake test
3939

4040
stop:

test/cluster_commands_on_keys_test.rb

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,13 @@ def test_touch
9898
set_some_keys
9999
assert_equal 1, redis.touch('key1')
100100
assert_equal 1, redis.touch('key2')
101-
assert_equal 1, redis.touch('key1', 'key2')
101+
if version < '6'
102+
assert_equal 1, redis.touch('key1', 'key2')
103+
else
104+
assert_raises(Redis::CommandError, "CROSSSLOT Keys in request don't hash to the same slot") do
105+
redis.touch('key1', 'key2')
106+
end
107+
end
102108
assert_equal 2, redis.touch('{key}1', '{key}2')
103109
end
104110
end

test/cluster_commands_on_server_test.rb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ def test_client_list
4343
a_client_info = redis.client(:list).first
4444
actual = a_client_info.keys.sort
4545
expected = %w[addr age cmd db events fd flags id idle multi name obl oll omem psub qbuf qbuf-free sub]
46+
if version >= '6'
47+
expected << 'user'
48+
end
4649
assert_equal expected, actual
4750
end
4851

@@ -83,6 +86,11 @@ def test_command_info
8386
['set', -3, %w[write denyoom], 1, 1, 1],
8487
['eval', -3, %w[noscript movablekeys], 0, 0, 0]
8588
]
89+
if version >= '6'
90+
expected[0] << ["@read", "@string", "@fast"]
91+
expected[1] << ["@write", "@string", "@slow"]
92+
expected[2] << ["@slow", "@scripting"]
93+
end
8694
assert_equal expected, redis.command(:info, :get, :set, :eval)
8795
end
8896

0 commit comments

Comments
 (0)