Skip to content

Commit

Permalink
added filtering by platform (#238)
Browse files Browse the repository at this point in the history
* added filtering by platform

* ran formatting and fixed an error

* fixed issue after runnig poetry flake8
  • Loading branch information
slice4e authored Oct 10, 2023
1 parent 15cc694 commit 3351065
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 7 deletions.
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 @@ -951,12 +970,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

0 comments on commit 3351065

Please sign in to comment.