From b583d957f1799dbd5fdc2c3e32407492c5878860 Mon Sep 17 00:00:00 2001 From: Nedyalko Dyakov <1547186+ndyakov@users.noreply.github.com> Date: Tue, 29 Apr 2025 13:08:34 +0300 Subject: [PATCH] chore(ci): Use redis 8 rc2 image. (#3361) * chore(ci): Use redis 8 rc2 image * test(timeseries): fix duplicatePolicy check --- .github/actions/run-tests/action.yml | 2 +- .github/workflows/build.yml | 6 +++--- timeseries_commands_test.go | 14 ++++++++++++-- 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/.github/actions/run-tests/action.yml b/.github/actions/run-tests/action.yml index 2edb16d3..08323aa5 100644 --- a/.github/actions/run-tests/action.yml +++ b/.github/actions/run-tests/action.yml @@ -25,7 +25,7 @@ runs: # Mapping of redis version to redis testing containers declare -A redis_version_mapping=( - ["8.0-RC1"]="8.0-RC1-pre" + ["8.0-RC2"]="8.0-RC2-pre" ["7.4.2"]="rs-7.4.0-v2" ["7.2.7"]="rs-7.2.0-v14" ) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f88ca672..810ab509 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -18,7 +18,7 @@ jobs: fail-fast: false matrix: redis-version: - - "8.0-RC1" # 8.0 RC1 + - "8.0-RC2" # 8.0 RC2 - "7.4.2" # should use redis stack 7.4 go-version: - "1.23.x" @@ -43,7 +43,7 @@ jobs: # Mapping of redis version to redis testing containers declare -A redis_version_mapping=( - ["8.0-RC1"]="8.0-RC1-pre" + ["8.0-RC2"]="8.0-RC2-pre" ["7.4.2"]="rs-7.4.0-v2" ) if [[ -v redis_version_mapping[$REDIS_VERSION] ]]; then @@ -72,7 +72,7 @@ jobs: fail-fast: false matrix: redis-version: - - "8.0-RC1" # 8.0 RC1 + - "8.0-RC2" # 8.0 RC2 - "7.4.2" # should use redis stack 7.4 - "7.2.7" # should redis stack 7.2 go-version: diff --git a/timeseries_commands_test.go b/timeseries_commands_test.go index d0d865b4..fdef3e60 100644 --- a/timeseries_commands_test.go +++ b/timeseries_commands_test.go @@ -269,11 +269,21 @@ var _ = Describe("RedisTimeseries commands", Label("timeseries"), func() { if client.Options().Protocol == 2 { Expect(resultInfo["labels"].([]interface{})[0]).To(BeEquivalentTo([]interface{}{"Time", "Series"})) Expect(resultInfo["retentionTime"]).To(BeEquivalentTo(10)) - Expect(resultInfo["duplicatePolicy"]).To(BeEquivalentTo(redis.Nil)) + if RedisVersion >= 8 { + Expect(resultInfo["duplicatePolicy"]).To(BeEquivalentTo("block")) + } else { + // Older versions of Redis had a bug where the duplicate policy was not set correctly + Expect(resultInfo["duplicatePolicy"]).To(BeEquivalentTo(redis.Nil)) + } } else { Expect(resultInfo["labels"].(map[interface{}]interface{})["Time"]).To(BeEquivalentTo("Series")) Expect(resultInfo["retentionTime"]).To(BeEquivalentTo(10)) - Expect(resultInfo["duplicatePolicy"]).To(BeEquivalentTo(redis.Nil)) + if RedisVersion >= 8 { + Expect(resultInfo["duplicatePolicy"]).To(BeEquivalentTo("block")) + } else { + // Older versions of Redis had a bug where the duplicate policy was not set correctly + Expect(resultInfo["duplicatePolicy"]).To(BeEquivalentTo(redis.Nil)) + } } opt = &redis.TSAlterOptions{DuplicatePolicy: "min"} resultAlter, err = client.TSAlter(ctx, "1", opt).Result()