Skip to content

Commit

Permalink
Add Redis 6.2 to the GitHub Actions test suite (#979)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
rhymes committed Mar 20, 2021
1 parent 05425d4 commit 6542934
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 7 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/test.yaml
Expand Up @@ -34,7 +34,7 @@ jobs:
fail-fast: false
matrix:
os: ["ubuntu-latest"]
redis: ["6.0"]
redis: ["6.2"]
ruby: ["3.0", "2.7", "2.6", "2.5", "2.4"]
driver: ["ruby", "hiredis", "synchrony"]
runs-on: ${{ matrix.os }}
Expand Down Expand Up @@ -87,7 +87,7 @@ jobs:
fail-fast: false
matrix:
os: ["ubuntu-latest"]
redis: ["5.0", "4.0", "3.2", "3.0"]
redis: ["6.0", "5.0", "4.0", "3.2", "3.0"]
ruby: ["jruby-9.2.9.0", "2.3"]
driver: ["ruby"]
runs-on: ${{ matrix.os }}
Expand Down
9 changes: 8 additions & 1 deletion test/cluster_commands_on_server_test.rb
Expand Up @@ -44,6 +44,7 @@ def test_client_list
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'
assert_equal expected.sort, actual.sort
end

Expand Down Expand Up @@ -79,10 +80,16 @@ def test_command_getkeys
end

def test_command_info
eval_command_flags = if version >= '6.2'
%w[noscript may_replicate movablekeys]
else
%w[noscript movablekeys]
end

expected = [
['get', 2, %w[readonly fast], 1, 1, 1],
['set', -3, %w[write denyoom], 1, 1, 1],
['eval', -3, %w[noscript movablekeys], 0, 0, 0]
['eval', -3, eval_command_flags, 0, 0, 0]
]
if version >= '6'
expected[0] << ["@read", "@string", "@fast"]
Expand Down
15 changes: 11 additions & 4 deletions test/lint/streams.rb
Expand Up @@ -116,10 +116,17 @@ def test_xtrim_with_not_existed_stream
end

def test_xtrim_with_invalid_arguments
assert_equal 0, redis.xtrim('', '')
assert_equal 0, redis.xtrim(nil, nil)
assert_equal 0, redis.xtrim('s1', 0)
assert_equal 0, redis.xtrim('s1', -1, approximate: true)
if version >= '6.2'
assert_raises(Redis::CommandError) { redis.xtrim('', '') }
assert_raises(Redis::CommandError) { redis.xtrim(nil, nil) }
assert_equal 0, redis.xtrim('s1', 0)
assert_raises(Redis::CommandError) { redis.xtrim('s1', -1, approximate: true) }
else
assert_equal 0, redis.xtrim('', '')
assert_equal 0, redis.xtrim(nil, nil)
assert_equal 0, redis.xtrim('s1', 0)
assert_equal 0, redis.xtrim('s1', -1, approximate: true)
end
end

def test_xdel_with_splatted_entry_ids
Expand Down

0 comments on commit 6542934

Please sign in to comment.