Skip to content

Commit 0d8f365

Browse files
authored
Prevent stats to fail on unknown commands (#288)
* Prevent stats to fail on unkown commands * Fix `tested-groups` and `tested-commands` on `vector_db_benchmark_test`
1 parent 34615be commit 0d8f365

File tree

2 files changed

+15
-4
lines changed

2 files changed

+15
-4
lines changed

redis_benchmarks_specification/__cli__/stats.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,8 @@ def generate_stats_cli_command_logic(args, project_name, project_version):
108108
benchmark_config = {}
109109
requires_override = False
110110
test_result = True
111+
tested_groups_match_origin = True
112+
111113
with open(test_file, "r") as stream:
112114

113115
try:
@@ -291,7 +293,7 @@ def generate_stats_cli_command_logic(args, project_name, project_version):
291293
)
292294

293295
if tested_groups != origin_tested_groups:
294-
requires_override = True
296+
tested_groups_match_origin = False
295297
benchmark_config["tested-groups"] = tested_groups
296298
logging.warn(
297299
"there is a difference between specified test-groups in the yaml (name={}) and the ones we've detected {}!={}".format(
@@ -312,7 +314,15 @@ def generate_stats_cli_command_logic(args, project_name, project_version):
312314
test_result = False
313315
overall_result &= test_result
314316

315-
if requires_override and override_enabled:
317+
if not tested_groups_match_origin:
318+
if len(tested_groups) > 0:
319+
overall_result = False
320+
else:
321+
logging.warn(
322+
"difference between specified and detected test-groups was ignored since command info is not available in this benchmark version"
323+
)
324+
325+
if (requires_override or not tested_groups_match_origin) and override_enabled:
316326
logging.info(
317327
"Saving a new version of the file {} with the overrided data".format(
318328
test_file

redis_benchmarks_specification/test-suites/vector_db_benchmark_test.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,10 @@ dbconfig:
1010
requests:
1111
memory: 1g
1212
tested-groups:
13-
- redisearch
14-
tested-commands:
1513
- search
14+
tested-commands:
15+
- hset
16+
- ft.search
1617
redis-topologies:
1718
- oss-standalone-with-redisearch
1819
build-variants:

0 commit comments

Comments
 (0)