From: Kienan Stewart Date: Thu, 25 May 2023 14:17:09 +0000 (-0400) Subject: bt benchmark: Collect commits to benchmark into a set X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=73fe8ab44b7018864dad056448057c7b2d1e6050;p=lttng-ci.git bt benchmark: Collect commits to benchmark into a set By collecting the the commits in to a set, we can give an indication in the test runner how many jobs are going to be generated and the overall progress of the lava job submissions. The same commit hash may be present in multiple branches, using a set prevents double checking the same hash twice. Change-Id: I38a297f4147e4055d40cc462d0fdd7b10df88f46 --- diff --git a/scripts/babeltrace-benchmark/benchmark.py b/scripts/babeltrace-benchmark/benchmark.py index 0c8476d..d1805cf 100644 --- a/scripts/babeltrace-benchmark/benchmark.py +++ b/scripts/babeltrace-benchmark/benchmark.py @@ -394,19 +394,20 @@ def launch_jobs(branches, git_path, wait_for_completion, debug, force): Lauch jobs for all missing results. """ client = get_client() + commits_to_test = set() for branch, cutoff in branches.items(): - commits = get_git_log(branch, cutoff, git_path) - + commits = [x for x in get_git_log(branch, cutoff, git_path) if x not in invalid_commits] with tempfile.TemporaryDirectory() as workdir: for commit in commits: - if commit in invalid_commits: - continue b_results = get_benchmark_results(client, commit, workdir)[0] if b_results and not force: continue - lava_submit.submit( - commit, wait_for_completion=wait_for_completion, debug=debug - ) + commits_to_test.add(commit) + for index, commit in enumerate(commits_to_test): + print("Job {}/{}".format(index+1, len(commits_to_test))) + lava_submit.submit( + commit, wait_for_completion=wait_for_completion, debug=debug + ) def main():