Skip to content

Commit

Permalink
Get baseline run
Browse files Browse the repository at this point in the history
  • Loading branch information
dianaclarke committed Apr 22, 2021
1 parent 297dd1a commit c2413cd
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
14 changes: 14 additions & 0 deletions conbench/app/benchmarks.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,20 @@ def get_display_run(self, run_id):
self._augment(run)
return run

def get_display_baseline_run(self, sha, machine_id):
response = self.api_get("api.runs", sha=sha, machine_id=machine_id)
if response.status_code != 200:
self.flash("Error getting run.")
return None

runs = response.json
if runs:
run = runs[0]
self._augment(run)
return run

return None

def get_display_runs(self):
runs, response = self._get_runs()
if response.status_code != 200:
Expand Down
4 changes: 3 additions & 1 deletion conbench/app/runs.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ def get(self, run_id):
contender_run, baseline_run = self.get_display_run(run_id), None
if contender_run:
parent = contender_run["commit"]["parent_sha"]
baseline_run = self.get_display_run(run_id) # TODO: get baseline run
baseline_run = self.get_display_baseline_run(
parent, contender_run["machine"]["id"]
)

benchmarks, response = self._get_benchmarks(run_id)
if response.status_code != 200:
Expand Down

0 comments on commit c2413cd

Please sign in to comment.