Skip to content

Commit 40c7373

Browse files
in the case of a bad benchmark config exit with error. benchmark config utf-8 reading (#293)
* Added option for in case of failure exit immediately. * in the case of a bad benchmark config exit with error * Bumping version from 0.6.23 to 0.6.24
1 parent 5e074bc commit 40c7373

File tree

5 files changed

+26
-4
lines changed

5 files changed

+26
-4
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "redisbench-admin"
3-
version = "0.6.23"
3+
version = "0.6.24"
44
description = "Redis benchmark run helper. A wrapper around Redis and Redis Modules benchmark tools ( ftsb_redisearch, memtier_benchmark, redis-benchmark, aibench, etc... )."
55
authors = ["filipecosta90 <[email protected]>","Redis Performance Group <[email protected]>"]
66
readme = "README.md"

redisbench_admin/run/args.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
SETUP = os.getenv("SETUP", "")
2626
S3_BUCKET_NAME = os.getenv("S3_BUCKET_NAME", "ci.benchmarks.redislabs")
2727
PUSH_S3 = bool(os.getenv("PUSH_S3", False))
28+
FAIL_FAST = bool(os.getenv("FAIL_FAST", False))
2829
PROFILERS_DSO = os.getenv("PROFILERS_DSO", None)
2930
PROFILERS_ENABLED = bool(int(os.getenv("PROFILE", 0)))
3031
PROFILERS = os.getenv("PROFILERS", PROFILERS_DEFAULT)
@@ -41,6 +42,14 @@ def common_run_args(parser):
4142
action="store_true",
4243
help="Keep environment and topology up after benchmark.",
4344
)
45+
parser.add_argument(
46+
"--fail_fast",
47+
required=False,
48+
default=FAIL_FAST,
49+
action="store_true",
50+
help="In case of failure exit immediately. Otherwise run all other tests and then exit on error.",
51+
)
52+
4453
parser.add_argument(
4554
"--dbdir_folder",
4655
type=str,

redisbench_admin/run_local/run_local.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ def run_local_command_logic(args, project_name, project_version):
114114
)
115115

116116
(
117+
_,
117118
benchmark_definitions,
118119
default_metrics,
119120
_,

redisbench_admin/run_remote/run_remote.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ def run_remote_command_logic(args, project_name, project_version):
122122
ssh_pem_check(EC2_PRIVATE_PEM, private_key)
123123

124124
(
125+
benchmark_defs_result,
125126
benchmark_definitions,
126127
default_metrics,
127128
exporter_timemetric_path,
@@ -130,6 +131,14 @@ def run_remote_command_logic(args, project_name, project_version):
130131
) = prepare_benchmark_definitions(args)
131132

132133
return_code = 0
134+
if benchmark_defs_result is False:
135+
return_code = 1
136+
if args.fail_fast:
137+
logging.critical(
138+
"Detected errors while preparing benchmark definitions. Exiting right away!"
139+
)
140+
exit(1)
141+
133142
remote_envs = {}
134143
dirname = "."
135144
(

redisbench_admin/utils/benchmark_config.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ def parse_exporter_timemetric(metric_path: str, results_dict: dict):
5151

5252
def prepare_benchmark_definitions(args):
5353
benchmark_definitions = {}
54+
result = True
5455
defaults_filename, files = get_testfiles_to_process(args)
5556

5657
(
@@ -61,13 +62,15 @@ def prepare_benchmark_definitions(args):
6162
clusterconfig,
6263
) = get_defaults(defaults_filename)
6364
for usecase_filename in files:
64-
with open(usecase_filename, "r") as stream:
65-
result, benchmark_config, test_name = get_final_benchmark_config(
65+
with open(usecase_filename, "r", encoding="utf8") as stream:
66+
test_result, benchmark_config, test_name = get_final_benchmark_config(
6667
default_kpis, stream, usecase_filename
6768
)
68-
if result:
69+
result &= test_result
70+
if test_result:
6971
benchmark_definitions[test_name] = benchmark_config
7072
return (
73+
result,
7174
benchmark_definitions,
7275
default_metrics,
7376
exporter_timemetric_path,

0 commit comments

Comments
 (0)