[llvm-commits] [LNT] r166144 - in /lnt/trunk/lnt/server: reporting/dailyreport.py ui/templates/reporting/daily_report.html
Daniel Dunbar
daniel at zuster.org
Wed Oct 17 16:18:34 PDT 2012
Author: ddunbar
Date: Wed Oct 17 18:18:34 2012
New Revision: 166144
URL: http://llvm.org/viewvc/llvm-project?rev=166144&view=rev
Log:
dailyreport: Include links to run reports.
Modified:
lnt/trunk/lnt/server/reporting/dailyreport.py
lnt/trunk/lnt/server/ui/templates/reporting/daily_report.html
Modified: lnt/trunk/lnt/server/reporting/dailyreport.py
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/server/reporting/dailyreport.py?rev=166144&r1=166143&r2=166144&view=diff
==============================================================================
--- lnt/trunk/lnt/server/reporting/dailyreport.py (original)
+++ lnt/trunk/lnt/server/reporting/dailyreport.py Wed Oct 17 18:18:34 2012
@@ -22,10 +22,34 @@
# Computed values.
self.next_day = None
self.prior_days = None
+ self.machine_runs = None
self.reporting_machines = None
self.reporting_tests = None
self.result_table = None
+ def get_key_run(self, machine, day_index):
+ """
+ get_key_run(machine, day_index) -> Run or None
+
+ Get the "key" run for the given machine and day index, or None if there
+ are no runs for that machine and day.
+
+ The key run is an arbitrarily selected run from all the available runs
+ that reported for the reported run order, for that machine and day.
+ """
+
+ if self.machine_runs is None:
+ raise ArgumentError("report not initialized")
+ if day_index >= self.num_prior_days_to_include:
+ raise ArgumentError("invalid day index")
+
+ runs = self.machine_runs.get((machine.id, day_index))
+ if runs is None:
+ return None
+
+ # Select a key run arbitrarily.
+ return runs[0]
+
def build(self):
ts = self.ts
@@ -111,7 +135,7 @@
# overview across machines.
# Aggregate runs by machine ID and day index.
- machine_runs = util.multidict()
+ self.machine_runs = machine_runs = util.multidict()
for day_index,day_runs in enumerate(prior_runs):
for run in day_runs:
machine_runs[(run.machine_id, day_index)] = run
Modified: lnt/trunk/lnt/server/ui/templates/reporting/daily_report.html
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/server/ui/templates/reporting/daily_report.html?rev=166144&r1=166143&r2=166144&view=diff
==============================================================================
--- lnt/trunk/lnt/server/ui/templates/reporting/daily_report.html (original)
+++ lnt/trunk/lnt/server/ui/templates/reporting/daily_report.html Wed Oct 17 18:18:34 2012
@@ -23,10 +23,12 @@
<tr>
<td style="{{ styles.td }}">{{machine.name}}</td>
{% for i in range(report.num_prior_days_to_include)|reverse %}
-{% set order = report.prior_days_machine_order_map[i].get(machine) %}
-{% if order %}
+{% set key_run = report.get_key_run(machine, i) %}
+{% if key_run %}
{# FIXME: Don't hard code field name. #}
- <td style="{{ styles.td }}">{{order.llvm_project_revision}}</td>
+ <td style="{{ styles.td }}">
+ <a href="{{ ts_url }}/{{ key_run.id }}">{{
+ key_run.order.llvm_project_revision}}</a></td>
{% else %}
<td style="{{ styles.td }}" bgcolor="#FF0000">N/A</td>
{% endif %}
More information about the llvm-commits
mailing list