Skip to content

Commit 682b425

Browse files
Fixed SPEC validation.
1 parent 7378f18 commit 682b425

File tree

3 files changed

+22
-15
lines changed

3 files changed

+22
-15
lines changed

redis_benchmarks_specification/__cli__/stats.py

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,9 @@ def generate_stats_cli_command_logic(args, project_name, project_version):
223223
command = command.replace("'", "")
224224
if "-key-pattern" in command:
225225
continue
226+
# Skip command-ratio and other memtier arguments that start with -
227+
if command.startswith("-"):
228+
continue
226229
command = command.lower()
227230
if command not in tested_commands:
228231
tested_commands.append(command)
@@ -238,14 +241,16 @@ def generate_stats_cli_command_logic(args, project_name, project_version):
238241
if command not in tracked_commands_json:
239242
tracked_commands_json[command] = command_json
240243

241-
group = command_json["group"]
242-
if group not in tested_groups:
244+
# Only process if command_json has group information
245+
if "group" in command_json:
246+
group = command_json["group"]
247+
if group not in tested_groups:
243248

244-
tested_groups.append(group)
245-
if group not in tracked_groups:
246-
tracked_groups.append(group)
247-
tracked_groups_hist[group] = 0
248-
tracked_groups_hist[group] = tracked_groups_hist[group] + 1
249+
tested_groups.append(group)
250+
if group not in tracked_groups:
251+
tracked_groups.append(group)
252+
tracked_groups_hist[group] = 0
253+
tracked_groups_hist[group] = tracked_groups_hist[group] + 1
249254

250255
# Calculate total connections
251256
total_connections = clients * threads
@@ -262,12 +267,12 @@ def generate_stats_cli_command_logic(args, project_name, project_version):
262267
data_sizes[data_size] = 0
263268
data_sizes[data_size] = data_sizes[data_size] + 1
264269

265-
if tested_commands != origin_tested_commands:
270+
if sorted(tested_commands) != sorted(origin_tested_commands):
266271
requires_override = True
267272
benchmark_config["tested-commands"] = tested_commands
268273
logging.warn(
269274
"there is a difference between specified test-commands in the yaml (name={}) and the ones we've detected {}!={}".format(
270-
test_name, origin_tested_commands, tested_commands
275+
test_name, sorted(origin_tested_commands), sorted(tested_commands)
271276
)
272277
)
273278

@@ -323,12 +328,12 @@ def generate_stats_cli_command_logic(args, project_name, project_version):
323328
)
324329
)
325330

326-
if tested_groups != origin_tested_groups:
331+
if sorted(tested_groups) != sorted(origin_tested_groups):
327332
tested_groups_match_origin = False
328333
benchmark_config["tested-groups"] = tested_groups
329334
logging.warn(
330335
"there is a difference between specified test-groups in the yaml (name={}) and the ones we've detected {}!={}".format(
331-
test_name, origin_tested_groups, tested_groups
336+
test_name, sorted(origin_tested_groups), sorted(tested_groups)
332337
)
333338
)
334339

redis_benchmarks_specification/test-suites/memtier_benchmark-playbook-session-storage-100k-sessions.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,9 +140,9 @@ dbconfig:
140140
return 'OK'
141141
tested-groups:
142142
- hash
143-
- zset
143+
- sorted-set
144144
- set
145-
- string
145+
- scripting
146146

147147
tested-commands:
148148
- hgetall
@@ -154,6 +154,7 @@ tested-commands:
154154
- incr
155155
- expire
156156
- get
157+
- eval
157158

158159
redis-topologies:
159160
- oss-standalone

redis_benchmarks_specification/test-suites/memtier_benchmark-playbook-session-storage-1k-sessions.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,9 +140,9 @@ dbconfig:
140140
return 'OK'
141141
tested-groups:
142142
- hash
143-
- zset
143+
- sorted-set
144144
- set
145-
- string
145+
- scripting
146146

147147
tested-commands:
148148
- hgetall
@@ -154,6 +154,7 @@ tested-commands:
154154
- incr
155155
- expire
156156
- get
157+
- eval
157158

158159
redis-topologies:
159160
- oss-standalone

0 commit comments

Comments
 (0)