Skip to content

Commit a1f82e5

Browse files
authored
Merge pull request #3 from slice4e/fix_test_self_contained_coordinator_memtier
Pull Request: Fix test_self_contained_coordinator_memtier tests and stats validation This PR fixes multiple issues causing CI failures in the self-contained coordinator tests and stats validation. Issues Fixed: Architecture-specific stream routing - Tests were adding metrics to base streams but coordinators were reading from arch-specific streams (:amd64/:arm64 suffixes), causing NOGROUP errors in 7 tests Missing running_platform in key paths - Tests failed to find by.version keys because the key format was missing the running_platform component in 6 tests Metric validation false positives - Validation incorrectly failed when untested operation types had zero metrics (e.g., SET-only tests reporting 0 Gets/sec) Version extraction from Docker images - CLI couldn't extract git_version from Docker image tags like redis:7.4.0, breaking version-based key lookups Missing RedisJSON module support - Stats validation failed because JSON.GET and JSON.SET commands were not defined in commands.json, and the json group was missing from groups.json Test metadata mismatches - Three test YAMLs had incorrect metadata: rate-limiting test declared bitmap group but only uses scripting, and membership tests were missing sunion from tested-commands Changes: Fixed 13 tests in test_self_contained_coordinator_memtier.py Enhanced metric validation to skip untested operations Added RedisJSON commands and group definitions Corrected test suite metadata in 3 YAML files
2 parents 2003061 + d341d1b commit a1f82e5

File tree

8 files changed

+19845
-19745
lines changed

8 files changed

+19845
-19745
lines changed

commands.json

Lines changed: 19689 additions & 19675 deletions
Large diffs are not rendered by default.

groups.json

Lines changed: 39 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,70 +1,74 @@
11
{
22
"bitmap": {
3-
"display": "Bitmap",
4-
"description": "Operations on the Bitmap data type"
3+
"description": "Operations on the Bitmap data type",
4+
"display": "Bitmap"
55
},
66
"cluster": {
7-
"display": "Cluster",
8-
"description": "Redis Cluster management"
7+
"description": "Redis Cluster management",
8+
"display": "Cluster"
99
},
1010
"connection": {
11-
"display": "Connection",
12-
"description": "Client connections management"
11+
"description": "Client connections management",
12+
"display": "Connection"
1313
},
1414
"generic": {
15-
"display": "Generic",
16-
"description": "Generic commands"
15+
"description": "Generic commands",
16+
"display": "Generic"
1717
},
1818
"geo": {
19-
"display": "Geospatial indices",
20-
"description": "Operations on the Geospatial Index data type"
19+
"description": "Operations on the Geospatial Index data type",
20+
"display": "Geospatial indices"
2121
},
2222
"hash": {
23-
"display": "Hash",
24-
"description": "Operations on the Hash data type"
23+
"description": "Operations on the Hash data type",
24+
"display": "Hash"
2525
},
2626
"hyperloglog": {
27-
"display": "HyperLogLog",
28-
"description": "Operations on the HyperLogLog data type"
27+
"description": "Operations on the HyperLogLog data type",
28+
"display": "HyperLogLog"
2929
},
30+
"json": [
31+
"JSON.GET",
32+
"JSON.SET"
33+
],
3034
"list": {
31-
"display": "List",
32-
"description": "Operations on the List data type"
35+
"description": "Operations on the List data type",
36+
"display": "List"
3337
},
3438
"pubsub": {
35-
"display": "Pub/Sub",
36-
"description": "Pub/Sub commands"
39+
"description": "Pub/Sub commands",
40+
"display": "Pub/Sub"
3741
},
3842
"scripting": {
39-
"display": "Scripting and Functions",
40-
"description": "Redis server-side scripting and functions"
43+
"description": "Redis server-side scripting and functions",
44+
"display": "Scripting and Functions"
4145
},
4246
"sentinel": {
43-
"display": "Sentinel",
44-
"description": "Redis Sentinel commands"
47+
"description": "Redis Sentinel commands",
48+
"display": "Sentinel"
4549
},
4650
"server": {
47-
"display": "Server",
48-
"description": "Server management commands"
51+
"description": "Server management commands",
52+
"display": "Server"
4953
},
5054
"set": {
51-
"display": "Set",
52-
"description": "Operations on the Set data type"
55+
"description": "Operations on the Set data type",
56+
"display": "Set"
5357
},
5458
"sorted-set": {
55-
"display": "Sorted Set",
56-
"description": "Operations on the Sorted Set data type"
59+
"description": "Operations on the Sorted Set data type",
60+
"display": "Sorted Set"
5761
},
5862
"stream": {
59-
"display": "Stream",
60-
"description": "Operations on the Stream data type"
63+
"description": "Operations on the Stream data type",
64+
"display": "Stream"
6165
},
6266
"string": {
63-
"display": "String",
64-
"description": "Operations on the String data type"
67+
"description": "Operations on the String data type",
68+
"display": "String"
6569
},
6670
"transactions": {
67-
"display": "Transactions",
68-
"description": "Redis Transaction management"
71+
"description": "Redis Transaction management",
72+
"display": "Transactions"
6973
}
70-
}
74+
}

redis_benchmarks_specification/__cli__/cli.py

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,22 @@ def trigger_tests_dockerhub_cli_command_logic(args, project_name, project_versio
8080
decode_responses=False,
8181
)
8282
conn.ping()
83+
84+
# Extract version from Docker image tag if possible
85+
# e.g., "redis:7.4.0" -> "7.4.0"
86+
# e.g., "valkey/valkey:7.2.6-bookworm" -> "7.2.6"
87+
git_version = None
88+
if ":" in args.run_image:
89+
tag = args.run_image.split(":")[-1]
90+
# Try to extract version number from tag
91+
# Common patterns: "7.4.0", "7.2.6-bookworm", "latest"
92+
import re
93+
94+
version_match = re.match(r"^(\d+\.\d+\.\d+)", tag)
95+
if version_match:
96+
git_version = version_match.group(1)
97+
logging.info(f"Extracted git_version '{git_version}' from image tag")
98+
8399
testDetails = {}
84100
build_stream_fields, result = generate_benchmark_stream_request(
85101
args.id,
@@ -96,7 +112,7 @@ def trigger_tests_dockerhub_cli_command_logic(args, project_name, project_versio
96112
None,
97113
None,
98114
None,
99-
None,
115+
git_version, # Pass extracted version
100116
None,
101117
None,
102118
None,

redis_benchmarks_specification/__runner__/runner.py

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,13 +175,20 @@ def validate_benchmark_metrics(
175175
Args:
176176
results_dict: Dictionary containing benchmark results
177177
test_name: Name of the test being validated
178-
benchmark_config: Benchmark configuration (unused, for compatibility)
178+
benchmark_config: Benchmark configuration (optional, contains tested-commands)
179179
default_metrics: Default metrics configuration (unused, for compatibility)
180180
181181
Returns:
182182
tuple: (is_valid, error_message)
183183
"""
184184
try:
185+
# Get tested commands from config if available
186+
tested_commands = []
187+
if benchmark_config and "tested-commands" in benchmark_config:
188+
tested_commands = [
189+
cmd.lower() for cmd in benchmark_config["tested-commands"]
190+
]
191+
185192
# Define validation rules
186193
throughput_patterns = [
187194
"ops/sec",
@@ -219,6 +226,29 @@ def check_nested_dict(data, path=""):
219226
):
220227
return
221228

229+
# Skip operation-specific metrics for operations not being tested
230+
# For example, skip Gets.Ops/sec if only SET commands are tested
231+
if tested_commands:
232+
skip_metric = False
233+
operation_types = [
234+
"gets",
235+
"sets",
236+
"hgets",
237+
"hsets",
238+
"lpush",
239+
"rpush",
240+
"sadd",
241+
]
242+
for op_type in operation_types:
243+
if (
244+
op_type in metric_path_lower
245+
and op_type not in tested_commands
246+
):
247+
skip_metric = True
248+
break
249+
if skip_metric:
250+
return
251+
222252
# Check throughput metrics
223253
for pattern in throughput_patterns:
224254
if pattern in metric_path_lower:

redis_benchmarks_specification/test-suites/memtier_benchmark-playbook-rate-limiting-lua-100k-sessions.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ tested-commands:
3434
- bitcount
3535
- eval
3636
tested-groups:
37-
- bitmap
3837
- scripting
3938

4039
redis-topologies:

redis_benchmarks_specification/test-suites/memtier_benchmark-playbook-realtime-analytics-membership-pipeline-10.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ dbconfig:
3535
tested-commands:
3636
- smembers
3737
- sdiff
38+
- sunion
3839
redis-topologies:
3940
- oss-standalone
4041
build-variants:

redis_benchmarks_specification/test-suites/memtier_benchmark-playbook-realtime-analytics-membership.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ dbconfig:
3535
tested-commands:
3636
- smembers
3737
- sdiff
38+
- sunion
3839
redis-topologies:
3940
- oss-standalone
4041
build-variants:

0 commit comments

Comments
 (0)