Skip to content

Commit 00cf525

Browse files
Add topology filter to runners.py (#285)
* Add topology filter to runners.py * Move new topology filtering logic to `self_contained_coordinator.py` (#289) - reverts changes on `__runner__/args.py` - reverts changes on `__self_contained_coordinator__/runners.py` --------- Co-authored-by: Paulo Sousa <paulo.sousa@redis.com>
1 parent 2b204d7 commit 00cf525

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed

redis_benchmarks_specification/__self_contained_coordinator__/args.py

+6
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__/self_contained_coordinator.py

+21
Original file line numberDiff line numberDiff line change
@@ -375,6 +375,13 @@ def self_contained_coordinator_blocking_read(
375375
if len(newTestInfo[0]) < 2 or len(newTestInfo[0][1]) < 1:
376376
stream_id = ">"
377377
else:
378+
# Create args object with topology parameter
379+
class Args:
380+
def __init__(self):
381+
self.topology = ""
382+
383+
args = Args()
384+
378385
(
379386
stream_id,
380387
overall_result,
@@ -406,6 +413,7 @@ def self_contained_coordinator_blocking_read(
406413
default_metrics_str,
407414
docker_keep_env,
408415
restore_build_artifacts_default,
416+
args,
409417
)
410418
num_process_streams = num_process_streams + 1
411419
num_process_test_suites = num_process_test_suites + total_test_suite_runs
@@ -486,6 +494,7 @@ def process_self_contained_coordinator_stream(
486494
default_metrics_str="ALL_STATS.Totals.Ops/sec",
487495
docker_keep_env=False,
488496
restore_build_artifacts_default=True,
497+
args=None,
489498
):
490499
stream_id = "n/a"
491500
overall_result = False
@@ -772,6 +781,18 @@ def process_self_contained_coordinator_stream(
772781
for topology_spec_name in benchmark_config["redis-topologies"]:
773782
setup_name = topology_spec_name
774783
setup_type = "oss-standalone"
784+
785+
# Filter by topology if specified
786+
if (
787+
args is not None
788+
and args.topology
789+
and topology_spec_name != args.topology
790+
):
791+
logging.info(
792+
f"Skipping topology {topology_spec_name} as it doesn't match the requested topology {args.topology}"
793+
)
794+
continue
795+
775796
if topology_spec_name in topologies_map:
776797
topology_spec = topologies_map[topology_spec_name]
777798
setup_type = topology_spec["type"]

0 commit comments

Comments
 (0)