Skip to content

Commit 30709e2

Browse files
authored
Bump redis dependency to 6.0.0 (#20265)
* bump redis version * add changelog * add test for config options * Also remove connection pool
1 parent f279d3a commit 30709e2

File tree

5 files changed

+30
-5
lines changed

5 files changed

+30
-5
lines changed

agent_requirements.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ python3-gearman==0.1.0; sys_platform != 'win32'
5252
pyvmomi==8.0.3.0.1
5353
pywin32==310; sys_platform == 'win32'
5454
pyyaml==6.0.2
55-
redis==5.2.1
55+
redis==6.0.0
5656
requests-kerberos==0.15.0
5757
requests-ntlm==1.3.0
5858
requests-oauthlib==2.0.0

redisdb/changelog.d/20265.changed

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Bump `redis` dependency to `6.0.0` and stop supporting `charset`, `connection_pool`, and `errors` configuration options.

redisdb/datadog_checks/redisdb/redisdb.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -175,9 +175,6 @@ def _get_conn(self, instance_config):
175175
'username',
176176
'password',
177177
'socket_timeout',
178-
'connection_pool',
179-
'charset',
180-
'errors',
181178
'unix_socket_path',
182179
'ssl',
183180
'ssl_certfile',

redisdb/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ license = "BSD-3-Clause"
3636

3737
[project.optional-dependencies]
3838
deps = [
39-
"redis==5.2.1",
39+
"redis==6.0.0",
4040
]
4141

4242
[project.urls]

redisdb/tests/test_unit.py

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,33 @@ def test__check_total_commands_processed_present(check, aggregator, redis_instan
105105
aggregator.assert_metric('redis.net.commands', value=1000, tags=['test_total_commands_processed'])
106106

107107

108+
def test_check_all_available_config_options(check, aggregator, redis_instance, dd_run_check):
109+
"""
110+
The check should should create a connection with the supported config options
111+
"""
112+
113+
connection_args = {
114+
'db': 1,
115+
'username': 'user',
116+
'password': 'devops-best-friend',
117+
'socket_timeout': 5,
118+
'host': 'localhost',
119+
'port': '6379',
120+
'unix_socket_path': '/path',
121+
'ssl': True,
122+
'ssl_certfile': '/path',
123+
'ssl_keyfile': '/path',
124+
'ssl_ca_certs': '/path',
125+
'ssl_cert_reqs': 0,
126+
}
127+
redis_instance.update(connection_args)
128+
129+
redis_check = check(redis_instance)
130+
with mock.patch('redis.Redis') as redis_conn:
131+
dd_run_check(redis_check)
132+
assert redis_conn.call_args.kwargs == connection_args
133+
134+
108135
def test_slowlog_quiet_failure(check, aggregator, redis_instance):
109136
"""
110137
The check should not fail if the slowlog command fails with redis.ResponseError

0 commit comments

Comments
 (0)