Skip to content

Commit 6542934

Browse files
authored
Add Redis 6.2 to the GitHub Actions test suite (#979)
* Add Redis 6.2 to the GitHub Actions test suite * Fix cluster commands on server test for Redis 6.2 * Assert xtrim invalid commands raise a CommandError * Undo valid command in 6.2 * Fix string in GitHub action Redis list
1 parent 05425d4 commit 6542934

File tree

3 files changed

+21
-7
lines changed

3 files changed

+21
-7
lines changed

.github/workflows/test.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
fail-fast: false
3535
matrix:
3636
os: ["ubuntu-latest"]
37-
redis: ["6.0"]
37+
redis: ["6.2"]
3838
ruby: ["3.0", "2.7", "2.6", "2.5", "2.4"]
3939
driver: ["ruby", "hiredis", "synchrony"]
4040
runs-on: ${{ matrix.os }}
@@ -87,7 +87,7 @@ jobs:
8787
fail-fast: false
8888
matrix:
8989
os: ["ubuntu-latest"]
90-
redis: ["5.0", "4.0", "3.2", "3.0"]
90+
redis: ["6.0", "5.0", "4.0", "3.2", "3.0"]
9191
ruby: ["jruby-9.2.9.0", "2.3"]
9292
driver: ["ruby"]
9393
runs-on: ${{ matrix.os }}

test/cluster_commands_on_server_test.rb

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ def test_client_list
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]
4646
expected << 'user' << 'argv-mem' << 'tot-mem' if version >= '6'
47+
expected << 'laddr' << 'redir' if version >= '6.2'
4748
assert_equal expected.sort, actual.sort
4849
end
4950

@@ -79,10 +80,16 @@ def test_command_getkeys
7980
end
8081

8182
def test_command_info
83+
eval_command_flags = if version >= '6.2'
84+
%w[noscript may_replicate movablekeys]
85+
else
86+
%w[noscript movablekeys]
87+
end
88+
8289
expected = [
8390
['get', 2, %w[readonly fast], 1, 1, 1],
8491
['set', -3, %w[write denyoom], 1, 1, 1],
85-
['eval', -3, %w[noscript movablekeys], 0, 0, 0]
92+
['eval', -3, eval_command_flags, 0, 0, 0]
8693
]
8794
if version >= '6'
8895
expected[0] << ["@read", "@string", "@fast"]

test/lint/streams.rb

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -116,10 +116,17 @@ def test_xtrim_with_not_existed_stream
116116
end
117117

118118
def test_xtrim_with_invalid_arguments
119-
assert_equal 0, redis.xtrim('', '')
120-
assert_equal 0, redis.xtrim(nil, nil)
121-
assert_equal 0, redis.xtrim('s1', 0)
122-
assert_equal 0, redis.xtrim('s1', -1, approximate: true)
119+
if version >= '6.2'
120+
assert_raises(Redis::CommandError) { redis.xtrim('', '') }
121+
assert_raises(Redis::CommandError) { redis.xtrim(nil, nil) }
122+
assert_equal 0, redis.xtrim('s1', 0)
123+
assert_raises(Redis::CommandError) { redis.xtrim('s1', -1, approximate: true) }
124+
else
125+
assert_equal 0, redis.xtrim('', '')
126+
assert_equal 0, redis.xtrim(nil, nil)
127+
assert_equal 0, redis.xtrim('s1', 0)
128+
assert_equal 0, redis.xtrim('s1', -1, approximate: true)
129+
end
123130
end
124131

125132
def test_xdel_with_splatted_entry_ids

0 commit comments

Comments
 (0)