bt benchmark: Collect commits to benchmark into a set
authorKienan Stewart <kstewart@efficios.com>
Thu, 25 May 2023 14:17:09 +0000 (10:17 -0400)
committerKienan Stewart <kstewart@efficios.com>
Thu, 25 May 2023 15:40:18 +0000 (11:40 -0400)
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

scripts/babeltrace-benchmark/benchmark.py

index 0c8476d0151a0d1b2573061c593d7a34877b6f42..d1805cf70941846482714d5acdae21739a6f53c8 100644 (file)
@@ -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():
This page took 0.025008 seconds and 4 git commands to generate.