diff --git a/.github/workflows/integration.yaml b/.github/workflows/integration.yaml index f8aa5c8932..fbfcecdf68 100644 --- a/.github/workflows/integration.yaml +++ b/.github/workflows/integration.yaml @@ -74,7 +74,7 @@ jobs: max-parallel: 15 fail-fast: false matrix: - redis-version: ['8.0-RC1-pre', '${{ needs.redis_version.outputs.CURRENT }}', '7.2.7', '6.2.17'] + redis-version: ['8.0-RC2-pre', '${{ needs.redis_version.outputs.CURRENT }}', '7.2.7', '6.2.17'] python-version: ['3.8', '3.13'] parser-backend: ['plain'] event-loop: ['asyncio'] diff --git a/docker-compose.yml b/docker-compose.yml index 6b544553cb..76a60398f3 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,6 +1,6 @@ --- x-client-libs-stack-image: &client-libs-stack-image - image: "redislabs/client-libs-test:${CLIENT_LIBS_TEST_STACK_IMAGE_TAG:-7.4.2}" + image: "redislabs/client-libs-test:${CLIENT_LIBS_TEST_STACK_IMAGE_TAG:-rs-7.4.0-v2}" x-client-libs-image: &client-libs-image image: "redislabs/client-libs-test:${CLIENT_LIBS_TEST_IMAGE_TAG:-7.4.2}" diff --git a/tests/test_asyncio/test_timeseries.py b/tests/test_asyncio/test_timeseries.py index b21f7d0ac8..24c36c9ca2 100644 --- a/tests/test_asyncio/test_timeseries.py +++ b/tests/test_asyncio/test_timeseries.py @@ -7,6 +7,8 @@ from tests.conftest import ( assert_resp_response, is_resp2_connection, + skip_if_server_version_gte, + skip_if_server_version_lt, skip_ifmodversion_lt, ) @@ -75,7 +77,24 @@ async def test_alter(decoded_r: redis.Redis): @pytest.mark.redismod @skip_ifmodversion_lt("1.4.0", "timeseries") +@skip_if_server_version_lt("7.9.0") async def test_alter_duplicate_policy(decoded_r: redis.Redis): + assert await decoded_r.ts().create(1) + info = await decoded_r.ts().info(1) + assert_resp_response( + decoded_r, "block", info.get("duplicate_policy"), info.get("duplicatePolicy") + ) + assert await decoded_r.ts().alter(1, duplicate_policy="min") + info = await decoded_r.ts().info(1) + assert_resp_response( + decoded_r, "min", info.get("duplicate_policy"), info.get("duplicatePolicy") + ) + + +@pytest.mark.redismod +@skip_ifmodversion_lt("1.4.0", "timeseries") +@skip_if_server_version_gte("7.9.0") +async def test_alter_duplicate_policy_prior_redis_8(decoded_r: redis.Redis): assert await decoded_r.ts().create(1) info = await decoded_r.ts().info(1) assert_resp_response( @@ -722,7 +741,27 @@ async def test_info(decoded_r: redis.Redis): @pytest.mark.redismod @skip_ifmodversion_lt("1.4.0", "timeseries") +@skip_if_server_version_lt("7.9.0") async def test_info_duplicate_policy(decoded_r: redis.Redis): + await decoded_r.ts().create( + 1, retention_msecs=5, labels={"currentLabel": "currentData"} + ) + info = await decoded_r.ts().info(1) + assert_resp_response( + decoded_r, "block", info.get("duplicate_policy"), info.get("duplicatePolicy") + ) + + await decoded_r.ts().create("time-serie-2", duplicate_policy="min") + info = await decoded_r.ts().info("time-serie-2") + assert_resp_response( + decoded_r, "min", info.get("duplicate_policy"), info.get("duplicatePolicy") + ) + + +@pytest.mark.redismod +@skip_ifmodversion_lt("1.4.0", "timeseries") +@skip_if_server_version_gte("7.9.0") +async def test_info_duplicate_policy_prior_redis_8(decoded_r: redis.Redis): await decoded_r.ts().create( 1, retention_msecs=5, labels={"currentLabel": "currentData"} ) diff --git a/tests/test_timeseries.py b/tests/test_timeseries.py index fb604d0329..ad98b1ca2f 100644 --- a/tests/test_timeseries.py +++ b/tests/test_timeseries.py @@ -9,6 +9,8 @@ _get_client, assert_resp_response, is_resp2_connection, + skip_if_server_version_gte, + skip_if_server_version_lt, skip_ifmodversion_lt, ) @@ -84,7 +86,8 @@ def test_alter(client): @pytest.mark.redismod @skip_ifmodversion_lt("1.4.0", "timeseries") -def test_alter_duplicate_policy(client): +@skip_if_server_version_gte("7.9.0") +def test_alter_duplicate_policy_prior_redis_8(client): assert client.ts().create(1) info = client.ts().info(1) assert_resp_response( @@ -97,6 +100,22 @@ def test_alter_duplicate_policy(client): ) +@pytest.mark.redismod +@skip_ifmodversion_lt("1.4.0", "timeseries") +@skip_if_server_version_lt("7.9.0") +def test_alter_duplicate_policy(client): + assert client.ts().create(1) + info = client.ts().info(1) + assert_resp_response( + client, "block", info.get("duplicate_policy"), info.get("duplicatePolicy") + ) + assert client.ts().alter(1, duplicate_policy="min") + info = client.ts().info(1) + assert_resp_response( + client, "min", info.get("duplicate_policy"), info.get("duplicatePolicy") + ) + + @pytest.mark.redismod def test_add(client): assert 1 == client.ts().add(1, 1, 1) @@ -967,7 +986,25 @@ def test_info(client): @pytest.mark.redismod @skip_ifmodversion_lt("1.4.0", "timeseries") +@skip_if_server_version_lt("7.9.0") def test_info_duplicate_policy(client): + client.ts().create(1, retention_msecs=5, labels={"currentLabel": "currentData"}) + info = client.ts().info(1) + assert_resp_response( + client, "block", info.get("duplicate_policy"), info.get("duplicatePolicy") + ) + + client.ts().create("time-serie-2", duplicate_policy="min") + info = client.ts().info("time-serie-2") + assert_resp_response( + client, "min", info.get("duplicate_policy"), info.get("duplicatePolicy") + ) + + +@pytest.mark.redismod +@skip_ifmodversion_lt("1.4.0", "timeseries") +@skip_if_server_version_gte("7.9.0") +def test_info_duplicate_policy_prior_redis_8(client): client.ts().create(1, retention_msecs=5, labels={"currentLabel": "currentData"}) info = client.ts().info(1) assert_resp_response(