Skip to content

added filtering by platform #238

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Oct 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions redis_benchmarks_specification/__builder__/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,8 @@ def builder_process_stream(
"{}_len_bytes".format(artifact)
] = bin_artifact_len
result = True
if b"platform" in testDetails:
build_stream_fields["platform"] = testDetails[b"platform"]
if result is True:
stream_id = conn.xadd(
STREAM_KEYNAME_NEW_BUILD_EVENTS, build_stream_fields
Expand Down
6 changes: 6 additions & 0 deletions redis_benchmarks_specification/__cli__/args.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,4 +130,10 @@ def spec_cli_args(parser):
default=-1,
help="Use the last N samples. by default will use all available values",
)
parser.add_argument(
"--platform",
type=str,
default="",
help="Only trigger tests on the specified platform.",
)
return parser
4 changes: 4 additions & 0 deletions redis_benchmarks_specification/__cli__/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,8 @@ def trigger_tests_cli_command_logic(args, project_name, project_version):
logging.info(
"Will trigger {} distinct tests {}.".format(len(commits), by_description)
)
if args.platform:
logging.info("Will trigger tests only for platform {}".format(args.platform))

hash_regexp = args.hash_regexp
if hash_regexp == ".*":
Expand Down Expand Up @@ -250,6 +252,8 @@ def trigger_tests_cli_command_logic(args, project_name, project_version):
) = get_commit_dict_from_sha(
cdict["git_hash"], "redis", "redis", cdict, True, args.gh_token
)
if args.platform:
commit_dict["platform"] = args.platform
if result is True:
stream_id = "n/a"
if args.dry_run is False:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,26 @@ def process_self_contained_coordinator_stream(
run_arch,
) = extract_build_info_from_streamdata(testDetails)

if run_arch == arch:
skip_test = False
if b"platform" in testDetails:
platform = testDetails[b"platform"]
if running_platform != platform:
skip_test = True
logging.info(
"skipping stream_id {} given plaform {}!={}".format(
stream_id, running_platform, platform
)
)

if run_arch != arch:
skip_test = True
logging.info(
"skipping stream_id {} given arch {}!={}".format(
stream_id, run_arch, arch
)
)

if skip_test is False:
overall_result = True
profiler_dashboard_links = []
if docker_air_gap:
Expand Down Expand Up @@ -953,12 +972,6 @@ def process_self_contained_coordinator_stream(

overall_result &= test_result

else:
logging.info(
"skipping stream_id {} given arch {}!={}".format(
stream_id, run_arch, arch
)
)
else:
logging.error("Missing commit information within received message.")
except:
Expand Down