[LNT] r333896 - Fix use of field index in daily report

John Brawn via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 4 06:08:19 PDT 2018


Author: john.brawn
Date: Mon Jun  4 06:08:19 2018
New Revision: 333896

URL: http://llvm.org/viewvc/llvm-project?rev=333896&view=rev
Log:
Fix use of field index in daily report

Links to graph plots in the daily report make use of the field index but
haven't been updated to get it via get_field_index, causing these links to be
broken. Fix this by using get_field_index.

Differential Revision: https://reviews.llvm.org/D47581

Modified:
    lnt/trunk/lnt/server/ui/templates/reporting/daily_report.html
    lnt/trunk/tests/server/ui/V4Pages.py

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=333896&r1=333895&r2=333896&view=diff
==============================================================================
--- lnt/trunk/lnt/server/ui/templates/reporting/daily_report.html (original)
+++ lnt/trunk/lnt/server/ui/templates/reporting/daily_report.html Mon Jun  4 06:08:19 2018
@@ -247,7 +247,7 @@
     <td style="{{ styles.td }}"> </td>
     <td class="machine-name" style="{{ styles.td }}"><a href="{{
       ts_url}}/graph?plot.0={{machine.id}}.{{test.id}}.{{
-        field.index}}&highlight_run={{key_run.id}}">{{
+        report.ts.get_field_index(field)}}&highlight_run={{key_run.id}}">{{
           machine.name}}</a></td>
 {%-    set first_result_shown = false -%}
 {%-    for day_result in day_results|reverse -%}

Modified: lnt/trunk/tests/server/ui/V4Pages.py
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/tests/server/ui/V4Pages.py?rev=333896&r1=333895&r2=333896&view=diff
==============================================================================
--- lnt/trunk/tests/server/ui/V4Pages.py (original)
+++ lnt/trunk/tests/server/ui/V4Pages.py Mon Jun  4 06:08:19 2018
@@ -181,6 +181,13 @@ def get_table_body_content(table):
              for row in table.findall("./tbody/tr")]
 
 
+def get_table_links(table):
+    return [[link.get("href")
+             for cell in row.findall("./td")
+             for link in cell.findall("a")]
+             for row in table.findall("./tbody/tr")]
+
+
 def check_row_is_in_table(table, expected_row_content):
     body_content = get_table_body_content(table)
     assert expected_row_content in body_content, \
@@ -195,6 +202,13 @@ def check_table_content(table, expected_
         (expected_content, body_content)
 
 
+def check_table_links(table, expected_content):
+    body_content = get_table_links(table)
+    assert expected_content == body_content, \
+        "Expected table links %s, found %s" % \
+        (expected_content, body_content)
+
+
 def check_body_result_table(client, url, fieldname, expected_content):
     table = get_results_table(client, url, fieldname)
     check_table_content(table, expected_content)
@@ -435,6 +449,11 @@ def main():
                          ["", "machine2", "1.0000", "-", "900.00%", ""],
                          ["test2", ""],
                          ["", "machine2", "FAIL", "-", "PASS", ""]])
+    check_table_links(result_table_20120504,
+                      [[],
+                       ["/db_default/v4/nts/graph?plot.0=2.4.3&highlight_run=6"],
+                       [],
+                       ["/db_default/v4/nts/graph?plot.0=2.5.3&highlight_run=6"]])
 
     check_body_nr_tests_table(
         client, '/v4/nts/daily_report/2012/5/04',
@@ -453,6 +472,15 @@ def main():
                          ["", "machine2", "1.0000", '-', '20.00%', ""],
                          ["test_mhash_on_run", ""],
                          ["", "machine2", "1.0000", '-', '20.00%', ""], ])
+    check_table_links(result_table_20120513,
+                      [[],
+                       ['/db_default/v4/nts/graph?plot.0=2.6.3&highlight_run=9'],
+                       [],
+                       ['/db_default/v4/nts/graph?plot.0=2.7.3&highlight_run=9'],
+                       [],
+                       ['/db_default/v4/nts/graph?plot.0=2.8.3&highlight_run=9'],
+                       [],
+                       ['/db_default/v4/nts/graph?plot.0=2.9.3&highlight_run=9']])
 
     sparkline_test6_xml = \
         get_sparkline(result_table_20120513, "test6", "machine2")




More information about the llvm-commits mailing list