From 63581a90772dbb8366180b9caf7bc1dd133e9dd2 Mon Sep 17 00:00:00 2001 From: Jean Boussier Date: Thu, 17 Aug 2023 08:28:46 +0200 Subject: [PATCH] Add Redis server 7.2 to the CI matrix Fix: https://github.com/redis/redis-rb/issues/1208 Also get rid of a unit test that is solely testing implementation details of the server. --- .github/workflows/test.yaml | 8 +++--- makefile | 2 +- .../remote_server_control_commands_test.rb | 2 +- test/redis/scanning_test.rb | 26 ------------------- 4 files changed, 6 insertions(+), 32 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index b09909c72..fc9dad1ca 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -37,7 +37,7 @@ jobs: runs-on: ubuntu-latest env: LOW_TIMEOUT: "0.01" - REDIS_BRANCH: "7.0" + REDIS_BRANCH: "7.2" steps: - name: Check out code uses: actions/checkout@v3 @@ -74,7 +74,7 @@ jobs: runs-on: ubuntu-latest env: LOW_TIMEOUT: "0.01" - REDIS_BRANCH: "7.0" + REDIS_BRANCH: "7.2" TRUFFLERUBYOPT: "--engine.Mode=latency" steps: - name: Check out code @@ -113,7 +113,7 @@ jobs: env: LOW_TIMEOUT: "0.01" DRIVER: ${{ matrix.driver }} - REDIS_BRANCH: "7.0" + REDIS_BRANCH: "7.2" steps: - name: Check out code uses: actions/checkout@v3 @@ -146,7 +146,7 @@ jobs: strategy: fail-fast: false matrix: - redis: ["6.2", "6.0", "5.0"] + redis: ["7.0", "6.2", "6.0", "5.0"] runs-on: ubuntu-latest env: LOW_TIMEOUT: "0.14" diff --git a/makefile b/makefile index 39d5a7429..9d9079f75 100644 --- a/makefile +++ b/makefile @@ -1,4 +1,4 @@ -REDIS_BRANCH ?= 7.0 +REDIS_BRANCH ?= 7.2 ROOT_DIR :=$(shell dirname $(realpath $(firstword $(MAKEFILE_LIST)))) TMP := tmp CONF := ${ROOT_DIR}/test/support/conf/redis-${REDIS_BRANCH}.conf diff --git a/test/redis/remote_server_control_commands_test.rb b/test/redis/remote_server_control_commands_test.rb index 53a7c1a74..e778054c2 100644 --- a/test/redis/remote_server_control_commands_test.rb +++ b/test/redis/remote_server_control_commands_test.rb @@ -75,7 +75,7 @@ def test_object assert_equal 1, r.object(:refcount, "list") encoding = r.object(:encoding, "list") - assert encoding == "ziplist" || encoding == "quicklist", "Wrong encoding for list" + assert encoding == "ziplist" || encoding == "quicklist" || encoding == "listpack", "Wrong encoding for list" assert r.object(:idletime, "list").is_a?(Integer) end diff --git a/test/redis/scanning_test.rb b/test/redis/scanning_test.rb index 53f4f22c6..72eac1344 100644 --- a/test/redis/scanning_test.rb +++ b/test/redis/scanning_test.rb @@ -127,32 +127,6 @@ def test_scan_each_block_match assert all_keys.sort == keys_from_scan.uniq.sort end - def test_sscan_with_encoding - %i[intset hashtable].each do |enc| - r.del "set" - - prefix = "" - prefix = "ele:" if enc == :hashtable - - elements = [] - 100.times { |j| elements << "#{prefix}#{j}" } - - r.sadd "set", elements - - assert_equal enc.to_s, r.object("encoding", "set") - - cursor = 0 - all_keys = [] - loop do - cursor, keys = r.sscan "set", cursor - all_keys += keys - break if cursor == "0" - end - - assert_equal 100, all_keys.uniq.size - end - end - def test_sscan_each_enumerator elements = [] 100.times { |j| elements << "ele:#{j}" }