Skip to content

Commit 3351065

Browse files
authored
added filtering by platform (#238)
* added filtering by platform * ran formatting and fixed an error * fixed issue after runnig poetry flake8
1 parent 15cc694 commit 3351065

File tree

4 files changed

+32
-7
lines changed

4 files changed

+32
-7
lines changed

redis_benchmarks_specification/__builder__/builder.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -353,6 +353,8 @@ def builder_process_stream(
353353
"{}_len_bytes".format(artifact)
354354
] = bin_artifact_len
355355
result = True
356+
if b"platform" in testDetails:
357+
build_stream_fields["platform"] = testDetails[b"platform"]
356358
if result is True:
357359
stream_id = conn.xadd(
358360
STREAM_KEYNAME_NEW_BUILD_EVENTS, build_stream_fields

redis_benchmarks_specification/__cli__/args.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,4 +130,10 @@ def spec_cli_args(parser):
130130
default=-1,
131131
help="Use the last N samples. by default will use all available values",
132132
)
133+
parser.add_argument(
134+
"--platform",
135+
type=str,
136+
default="",
137+
help="Only trigger tests on the specified platform.",
138+
)
133139
return parser

redis_benchmarks_specification/__cli__/cli.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,8 @@ def trigger_tests_cli_command_logic(args, project_name, project_version):
197197
logging.info(
198198
"Will trigger {} distinct tests {}.".format(len(commits), by_description)
199199
)
200+
if args.platform:
201+
logging.info("Will trigger tests only for platform {}".format(args.platform))
200202

201203
hash_regexp = args.hash_regexp
202204
if hash_regexp == ".*":
@@ -250,6 +252,8 @@ def trigger_tests_cli_command_logic(args, project_name, project_version):
250252
) = get_commit_dict_from_sha(
251253
cdict["git_hash"], "redis", "redis", cdict, True, args.gh_token
252254
)
255+
if args.platform:
256+
commit_dict["platform"] = args.platform
253257
if result is True:
254258
stream_id = "n/a"
255259
if args.dry_run is False:

redis_benchmarks_specification/__self_contained_coordinator__/self_contained_coordinator.py

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -433,7 +433,26 @@ def process_self_contained_coordinator_stream(
433433
run_arch,
434434
) = extract_build_info_from_streamdata(testDetails)
435435

436-
if run_arch == arch:
436+
skip_test = False
437+
if b"platform" in testDetails:
438+
platform = testDetails[b"platform"]
439+
if running_platform != platform:
440+
skip_test = True
441+
logging.info(
442+
"skipping stream_id {} given plaform {}!={}".format(
443+
stream_id, running_platform, platform
444+
)
445+
)
446+
447+
if run_arch != arch:
448+
skip_test = True
449+
logging.info(
450+
"skipping stream_id {} given arch {}!={}".format(
451+
stream_id, run_arch, arch
452+
)
453+
)
454+
455+
if skip_test is False:
437456
overall_result = True
438457
profiler_dashboard_links = []
439458
if docker_air_gap:
@@ -951,12 +970,6 @@ def process_self_contained_coordinator_stream(
951970

952971
overall_result &= test_result
953972

954-
else:
955-
logging.info(
956-
"skipping stream_id {} given arch {}!={}".format(
957-
stream_id, run_arch, arch
958-
)
959-
)
960973
else:
961974
logging.error("Missing commit information within received message.")
962975
except:

0 commit comments

Comments
 (0)