From b22d23eaac39fb674b5e6c286f89a09a38515a17 Mon Sep 17 00:00:00 2001 From: Ivana Kellyer Date: Tue, 6 Oct 2026 11:24:09 +0200 Subject: [PATCH] tests(redis): Remove send_default_pii --- .../redis/asyncio/test_redis_asyncio.py | 19 +------- .../redis/cluster/test_redis_cluster.py | 16 +------ .../test_redis_cluster_asyncio.py | 26 +++------- tests/integrations/redis/test_redis.py | 47 ------------------- 4 files changed, 9 insertions(+), 99 deletions(-) diff --git a/tests/integrations/redis/asyncio/test_redis_asyncio.py b/tests/integrations/redis/asyncio/test_redis_asyncio.py index f2a07bc0a4..ba30146d74 100644 --- a/tests/integrations/redis/asyncio/test_redis_asyncio.py +++ b/tests/integrations/redis/asyncio/test_redis_asyncio.py @@ -34,26 +34,11 @@ async def test_async_basic(sentry_init, capture_events): } -@pytest.mark.parametrize( - "is_transaction, send_default_pii, expected_first_ten", - [ - (False, False, ["GET 'foo'", "SET 'bar' [Filtered]", "SET 'baz' [Filtered]"]), - (True, True, ["GET 'foo'", "SET 'bar' 1", "SET 'baz' 2"]), - ], -) @pytest.mark.asyncio -async def test_async_redis_pipeline( - sentry_init, - capture_events, - capture_items, - is_transaction, - send_default_pii, - expected_first_ten, -): +async def test_async_redis_pipeline(sentry_init, capture_items): sentry_init( integrations=[RedisIntegration()], traces_sample_rate=1.0, - send_default_pii=send_default_pii, ) connection = FakeRedis() @@ -61,7 +46,7 @@ async def test_async_redis_pipeline( items = capture_items("span") with sentry_sdk.start_span(name="custom parent"): - pipeline = connection.pipeline(transaction=is_transaction) + pipeline = connection.pipeline() pipeline.get("foo") pipeline.set("bar", 1) pipeline.set("baz", 2) diff --git a/tests/integrations/redis/cluster/test_redis_cluster.py b/tests/integrations/redis/cluster/test_redis_cluster.py index 2f6072f844..42ac0eccea 100644 --- a/tests/integrations/redis/cluster/test_redis_cluster.py +++ b/tests/integrations/redis/cluster/test_redis_cluster.py @@ -105,24 +105,10 @@ def test_rediscluster_basic( assert attrs["db.redis.key"] == "bar" -@pytest.mark.parametrize( - "send_default_pii, expected_first_ten", - [ - (False, ["GET 'foo'", "SET 'bar' [Filtered]", "SET 'baz' [Filtered]"]), - (True, ["GET 'foo'", "SET 'bar' 1", "SET 'baz' 2"]), - ], -) -def test_rediscluster_pipeline( - sentry_init, - capture_events, - capture_items, - send_default_pii, - expected_first_ten, -): +def test_rediscluster_pipeline(sentry_init, capture_items): sentry_init( integrations=[RedisIntegration()], traces_sample_rate=1.0, - send_default_pii=send_default_pii, ) rc = redis.RedisCluster(host="localhost", port=6379) diff --git a/tests/integrations/redis/cluster_asyncio/test_redis_cluster_asyncio.py b/tests/integrations/redis/cluster_asyncio/test_redis_cluster_asyncio.py index adaf968272..bd819e3cd0 100644 --- a/tests/integrations/redis/cluster_asyncio/test_redis_cluster_asyncio.py +++ b/tests/integrations/redis/cluster_asyncio/test_redis_cluster_asyncio.py @@ -62,24 +62,23 @@ async def test_async_breadcrumb(sentry_init, capture_events): @pytest.mark.parametrize( - "send_default_pii, description", + "data_collection, description", [ - (False, "SET 'bar' [Filtered]"), - (True, "SET 'bar' 1"), + ({"database_query_data": False}, "SET 'bar' [Filtered]"), + ({"database_query_data": True}, "SET 'bar' 1"), ], ) @pytest.mark.asyncio async def test_async_basic( sentry_init, - capture_events, capture_items, - send_default_pii, + data_collection, description, ): sentry_init( integrations=[RedisIntegration()], traces_sample_rate=1.0, - send_default_pii=send_default_pii, + data_collection=data_collection, ) connection = cluster.RedisCluster(host="localhost", port=6379) @@ -106,24 +105,11 @@ async def test_async_basic( assert attrs["db.redis.key"] == "bar" -@pytest.mark.parametrize( - "send_default_pii, expected_first_ten", - [ - (False, ["GET 'foo'", "SET 'bar' [Filtered]", "SET 'baz' [Filtered]"]), - (True, ["GET 'foo'", "SET 'bar' 1", "SET 'baz' 2"]), - ], -) @pytest.mark.asyncio -async def test_async_redis_pipeline( - sentry_init, - capture_items, - send_default_pii, - expected_first_ten, -): +async def test_async_redis_pipeline(sentry_init, capture_items): sentry_init( integrations=[RedisIntegration()], traces_sample_rate=1.0, - send_default_pii=send_default_pii, ) connection = cluster.RedisCluster(host="localhost", port=6379) diff --git a/tests/integrations/redis/test_redis.py b/tests/integrations/redis/test_redis.py index db0fa77410..55f228fe30 100644 --- a/tests/integrations/redis/test_redis.py +++ b/tests/integrations/redis/test_redis.py @@ -42,53 +42,6 @@ def test_basic(sentry_init, capture_events): } -@pytest.mark.parametrize( - "data_collection, expected_first_ten", - [ - ( - {"database_query_data": False}, - ["GET 'foo'", "SET 'bar'", "SET 'baz'"], - ), - ( - {"database_query_data": True}, - ["GET 'foo'", "SET 'bar' 1", "SET 'baz' 2"], - ), - ], -) -def test_redis_pipeline_data_collection( - sentry_init, - capture_events, - capture_items, - data_collection, - expected_first_ten, -): - sentry_init( - integrations=[RedisIntegration()], - traces_sample_rate=1.0, - data_collection=data_collection, - ) - - connection = FakeRedis() - - items = capture_items("span") - - with sentry_sdk.start_span(name="custom parent"): - pipeline = connection.pipeline(transaction=False) - pipeline.get("foo") - pipeline.set("bar", 1) - pipeline.set("baz", 2) - pipeline.execute() - - sentry_sdk.flush() - - assert len(items) == 2 - pipeline_span, parent_span = items[0].payload, items[1].payload - - assert parent_span["name"] == "custom parent" - assert pipeline_span["name"] == "redis.pipeline.execute" - assert pipeline_span["attributes"]["sentry.op"] == "db.redis" - - def test_pii_data_redacted( sentry_init, capture_events,