Skip to content

Commit 206b231

Browse files
Add topology filter to runners.py
1 parent f424438 commit 206b231

File tree

4 files changed

+31
-0
lines changed

4 files changed

+31
-0
lines changed

redis_benchmarks_specification/__runner__/args.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,4 +208,9 @@ def create_client_runner_args(project_name):
208208
action="store_true",
209209
help="Run client in cluster mode.",
210210
)
211+
parser.add_argument(
212+
"--topology",
213+
default="",
214+
help="Filter tests to run only with the specified topology (e.g. oss-standalone)",
215+
)
211216
return parser

redis_benchmarks_specification/__self_contained_coordinator__/args.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,4 +165,10 @@ def create_self_contained_coordinator_args(project_name):
165165
default=100000,
166166
help="Run a subset of the tests based uppon a preset priority. By default runs all tests.",
167167
)
168+
parser.add_argument(
169+
"--topology",
170+
type=str,
171+
default="",
172+
help="Filter tests to run only with the specified topology (e.g. oss-standalone)",
173+
)
168174
return parser

redis_benchmarks_specification/__self_contained_coordinator__/runners.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ def process_self_contained_coordinator_stream(
116116
docker_air_gap=False,
117117
verbose=False,
118118
run_tests_with_dataset=False,
119+
args=None,
119120
):
120121
stream_id = "n/a"
121122
overall_result = False
@@ -197,6 +198,17 @@ def process_self_contained_coordinator_stream(
197198
)
198199
)
199200
for topology_spec_name in benchmark_config["redis-topologies"]:
201+
# Filter by topology if specified
202+
if (
203+
args.topology
204+
and args.topology != ""
205+
and topology_spec_name != args.topology
206+
):
207+
logging.info(
208+
f"Skipping topology {topology_spec_name} as it doesn't match the requested topology {args.topology}"
209+
)
210+
continue
211+
200212
test_result = False
201213
try:
202214
current_cpu_pos = cpuset_start_pos

redis_benchmarks_specification/__self_contained_coordinator__/self_contained_coordinator.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -367,6 +367,13 @@ def self_contained_coordinator_blocking_read(
367367
if len(newTestInfo[0]) < 2 or len(newTestInfo[0][1]) < 1:
368368
stream_id = ">"
369369
else:
370+
# Create args object with topology parameter
371+
class Args:
372+
def __init__(self):
373+
self.topology = ""
374+
375+
args = Args()
376+
370377
(
371378
stream_id,
372379
overall_result,
@@ -398,6 +405,7 @@ def self_contained_coordinator_blocking_read(
398405
default_metrics_str,
399406
docker_keep_env,
400407
restore_build_artifacts_default,
408+
args,
401409
)
402410
num_process_streams = num_process_streams + 1
403411
num_process_test_suites = num_process_test_suites + total_test_suite_runs

0 commit comments

Comments
 (0)