[llvm-commits] [zorg] r105566 - in /zorg/trunk/lnt/lnt: db/perfdbsummary.py testing/__init__.py viewer/simple.ptl
Daniel Dunbar
daniel at zuster.org
Mon Jun 7 16:00:27 PDT 2010
Author: ddunbar
Date: Mon Jun 7 18:00:26 2010
New Revision: 105566
URL: http://llvm.org/viewvc/llvm-project?rev=105566&view=rev
Log:
LNT/viewer: Add support for using a '.success' and '.status' naming convention
to attach test status results to performance data.
Modified:
zorg/trunk/lnt/lnt/db/perfdbsummary.py
zorg/trunk/lnt/lnt/testing/__init__.py
zorg/trunk/lnt/lnt/viewer/simple.ptl
Modified: zorg/trunk/lnt/lnt/db/perfdbsummary.py
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/lnt/lnt/db/perfdbsummary.py?rev=105566&r1=105565&r2=105566&view=diff
==============================================================================
--- zorg/trunk/lnt/lnt/db/perfdbsummary.py (original)
+++ zorg/trunk/lnt/lnt/db/perfdbsummary.py Mon Jun 7 18:00:26 2010
@@ -35,7 +35,7 @@
def is_up_to_date(self, db):
return self.revision == db.get_revision_number("Run")
-class SimpleSuiteSummary:
+class SimpleSuiteSummary(object):
@staticmethod
def fromdb(db, tag):
revision = db.get_revision_number("Test")
@@ -49,9 +49,9 @@
test_names = set()
parameter_sets = set()
test_map = {}
+ test_status_map = {}
for t in tests:
- name = t.name.split(str('.'),1)[1]
- test_names.add(name)
+ name = t.name.split('.', 1)[1]
items = [(k,v.value) for k,v in t.info.items()]
items.sort()
@@ -60,6 +60,17 @@
parameter_sets.add(key)
test_map[(name, key)] = t
+ if name.endswith('.success'):
+ test_name = name.rsplit('.', 1)[0]
+ test_status_map[test_name] = (name, False)
+ elif name.endswith('.status'):
+ test_name = name.rsplit('.', 1)[0]
+ test_status_map[test_name] = (name, True)
+ else:
+ test_name = name
+
+ test_names.add(test_name)
+
# Order the test names.
test_names = list(test_names)
test_names.sort()
@@ -73,15 +84,18 @@
parameter_sets = list(parameter_sets)
parameter_sets.sort()
- return SimpleSuiteSummary(revision, tag, test_names, test_map,
+ return SimpleSuiteSummary(revision, tag, test_names,
+ test_map, test_status_map,
parameter_keys, parameter_sets)
- def __init__(self, revision, tag, test_names, test_map,
+ def __init__(self, revision, tag, test_names,
+ test_map, test_status_map,
parameter_keys, parameter_sets):
self.revision = revision
self.tag = tag
self.test_names = test_names
self.test_map = test_map
+ self.test_status_map = test_status_map
self.parameter_keys = parameter_keys
self.parameter_sets = parameter_sets
Modified: zorg/trunk/lnt/lnt/testing/__init__.py
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/lnt/lnt/testing/__init__.py?rev=105566&r1=105565&r2=105566&view=diff
==============================================================================
--- zorg/trunk/lnt/lnt/testing/__init__.py (original)
+++ zorg/trunk/lnt/lnt/testing/__init__.py Mon Jun 7 18:00:26 2010
@@ -14,6 +14,11 @@
except ImportError:
import simplejson as json
+# We define the following constants for use as sample values by convention.
+PASS = 0
+FAIL = 1
+XFAIL = 2
+
def normalize_time(t):
if isinstance(t,float):
t = datetime.datetime.utcfromtimestamp(t)
Modified: zorg/trunk/lnt/lnt/viewer/simple.ptl
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/lnt/lnt/viewer/simple.ptl?rev=105566&r1=105565&r2=105566&view=diff
==============================================================================
--- zorg/trunk/lnt/lnt/viewer/simple.ptl (original)
+++ zorg/trunk/lnt/lnt/viewer/simple.ptl Mon Jun 7 18:00:26 2010
@@ -506,23 +506,50 @@
# Render the page.
- def get_cell_value [html] (test, name, pset):
+ def get_cell_value [html] (test, status_test, status_kind, name, pset):
run_values = sample_map.get((run.id,test.id))
prev_values = sample_map.get((prev_id,test.id))
- # FIXME: Check success
- failed = not run_values
+ # Determine whether this (test,pset) passed or failed in the current
+ # and previous runs.
+ run_failed = prev_failed = False
+ if not status_test:
+ run_failed = not run_values
+ prev_failed = not prev_values
+ else:
+ run_status = sample_map.get((run.id,status_test.id))
+ prev_status = sample_map.get((prev_id,status_test.id))
+
+ # FIXME: What to do about the multiple entries here. We could
+ # start by just treating non-matching samples as errors.
+ if status_kind == False: # .success style
+ run_failed = not run_status or not run_status[0]
+ prev_failed = not prev_status or not prev_status[0]
+ else:
+ run_failed = run_status and run_status[0] != 0
+ prev_failed = prev_status and prev_status[0] != 0
run_cell_value = "-"
if run_values:
run_cell_value = "%.4f" % min(run_values)
- if failed:
+ cell_color = None
+ if run_failed:
+ if prev_failed:
+ cell_color = (255,195,67)
+ else:
+ cell_color = (233,128,128)
+ else:
+ if prev_failed:
+ cell_color = (143,223,95)
+
+ if cell_color:
"""
- <td bgcolor="#FF0000">%s</td""" % run_cell_value
+ <td bgcolor="#%02x%02x%02x">%s</td""" % (
+ cell_color[0], cell_color[1], cell_color[2], run_cell_value)
else:
"""
- <td>%s</td""" % run_cell_value
+ <td>%s</td""" % (run_cell_value,)
if prev_values and run_values:
prev_value = min(prev_values)
@@ -587,7 +614,13 @@
<td></td><td></td>"""
continue
- get_cell_value(test, name, pset)
+ status_info = ts_summary.test_status_map.get(name)
+ if status_info:
+ status_name,status_kind = status_info
+ status_test = ts_summary.test_map.get((status_name,pset))
+ else:
+ status_test = status_kind = None
+ get_cell_value(test, status_test, status_kind, name, pset)
"""
</tr>"""
"""
More information about the llvm-commits
mailing list