Skip to content

Commit 0eb4aad

Browse files
Added --skip-setup-commands (#27)
* [add] Added --skip-setup-commands ( and renamed --skip-teardown to --skip-teardown-commands )
1 parent 9f2f709 commit 0eb4aad

File tree

3 files changed

+12
-6
lines changed

3 files changed

+12
-6
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.1.28"
3+
version = "0.1.29"
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 <filipecosta.90@gmail.com>"]
66
readme = "README.md"

redisbench_admin/run/args.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,10 @@ def create_run_arguments(parser):
1818
help='number of database shards used in the deployment')
1919
parser.add_argument('--pipeline', type=int, default=1,
2020
help='pipeline requests to Redis')
21-
parser.add_argument('--skip-teardown', default=False, action='store_true',
22-
help="If enabled will skip any teardown steps.")
21+
parser.add_argument('--skip-teardown-commands', default=False, action='store_true',
22+
help="If enabled will skip any teardown commands.")
23+
parser.add_argument('--skip-setup-commands', default=False, action='store_true',
24+
help="If enabled will skip any setup commands.")
2325
parser.add_argument('--continue-on-error', default=False, action='store_true',
2426
help="If enabled will continue on Redis ERR replies and only print the message.")
2527
parser.add_argument('--cluster-mode', default=False, action='store_true', help="Run client in cluster mode")

redisbench_admin/run/run.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ def run_command_logic(args):
3232
requests = args.requests
3333
continue_on_error = args.continue_on_error
3434
run_only_steps = None
35-
skip_teardown = args.skip_teardown
35+
skip_setup = args.skip_setup_commands
36+
skip_teardown = args.skip_teardown_commands
3637
if args.run_only_steps != "":
3738
run_only_steps = args.run_only_steps.split(",")
3839

@@ -128,7 +129,10 @@ def run_command_logic(args):
128129
progress = tqdm(unit="bench steps", total=total_steps)
129130
for repetition in range(1, args.repetitions + 1):
130131
if benchmark_repetitions_require_teardown is True or repetition == 1:
131-
aux_client = run_setup_commands(args, "setup", benchmark_config["setup"]["commands"], oss_cluster_mode)
132+
if skip_setup is False:
133+
aux_client = run_setup_commands(args, "setup", benchmark_config["setup"]["commands"], oss_cluster_mode)
134+
else:
135+
print("Implicitly skipping setup commands due to --skip-setup-commands flag")
132136
if "setup" in run_stages_inputs:
133137
run_setup_step = True
134138
if run_only_steps is not None and "setup" not in run_only_steps:
@@ -169,7 +173,7 @@ def run_command_logic(args):
169173
print("Running tear down steps...")
170174
run_setup_commands(args, "tear down", benchmark_config["teardown"]["commands"], oss_cluster_mode)
171175
else:
172-
print("Implicitly skipping teardown step due to --skip-teardown flag")
176+
print("Implicitly skipping teardown commands due to --skip-teardown-commands flag")
173177

174178
progress.update()
175179
end_time = dt.datetime.now()

0 commit comments

Comments
 (0)