[llvm-commits] [LNT] r156434 - in /lnt/trunk/lnt/server: db/testsuitedb.py ui/templates/v4_machine.html ui/views.py

Daniel Dunbar daniel at zuster.org
Tue May 8 16:06:38 PDT 2012


Author: ddunbar
Date: Tue May  8 18:06:38 2012
New Revision: 156434

URL: http://llvm.org/viewvc/llvm-project?rev=156434&view=rev
Log:
UI/v4_machine: Order runs properly (and fix a FIXME).

Modified:
    lnt/trunk/lnt/server/db/testsuitedb.py
    lnt/trunk/lnt/server/ui/templates/v4_machine.html
    lnt/trunk/lnt/server/ui/views.py

Modified: lnt/trunk/lnt/server/db/testsuitedb.py
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/server/db/testsuitedb.py?rev=156434&r1=156433&r2=156434&view=diff
==============================================================================
--- lnt/trunk/lnt/server/db/testsuitedb.py (original)
+++ lnt/trunk/lnt/server/db/testsuitedb.py Tue May  8 18:06:38 2012
@@ -147,6 +147,19 @@
                     db_key_name, self.__class__.__name__,
                     self.previous_order_id, self.next_order_id, fields)
 
+            def as_ordered_string(self):
+                """Return a readable value of the order object by printing the
+                fields in lexicographic order."""
+
+                # If there is only a single field, return it.
+                if len(self.fields) == 1:
+                    return self.get_field(self.fields[0])
+
+                # Otherwise, print as a tuple of string.
+                return '(%s)' % (
+                    ', '.join(self.get_field(field)
+                              for field in self.fields),)
+
             def __cmp__(self, b):
                 # SA occassionally uses comparison to check model instances
                 # verse some sentinels, so we ensure we support comparison

Modified: lnt/trunk/lnt/server/ui/templates/v4_machine.html
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/server/ui/templates/v4_machine.html?rev=156434&r1=156433&r2=156434&view=diff
==============================================================================
--- lnt/trunk/lnt/server/ui/templates/v4_machine.html (original)
+++ lnt/trunk/lnt/server/ui/templates/v4_machine.html Tue May  8 18:06:38 2012
@@ -78,7 +78,8 @@
 {% for run in runs %}
   <tr>
 {% if loop.first %}
-    <td rowspan="{{ runs|length }}" align=right>{{order}}</td>
+    <td rowspan="{{ runs|length }}" align=right>{{
+      order.as_ordered_string() }}</td>
 {% endif %}
     <td>{{ run.start_time }}</td>
     <td>{{ run.end_time }}s</td>

Modified: lnt/trunk/lnt/server/ui/views.py
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/server/ui/views.py?rev=156434&r1=156433&r2=156434&view=diff
==============================================================================
--- lnt/trunk/lnt/server/ui/views.py (original)
+++ lnt/trunk/lnt/server/ui/views.py Tue May  8 18:06:38 2012
@@ -674,13 +674,13 @@
     # Gather all the runs on this machine.
     ts = request.get_testsuite()
 
-    # FIXME: Remove hard coded field use here.
     associated_runs = util.multidict(
         (run_order, r)
-        for r,run_order in ts.query(ts.Run, ts.Order.llvm_project_revision).\
+        for r,run_order in ts.query(ts.Run, ts.Order).\
             join(ts.Order).\
             filter(ts.Run.machine_id == id))
     associated_runs = associated_runs.items()
+    associated_runs.sort()
 
     return render_template("v4_machine.html",
                            testsuite_name=g.testsuite_name, id=id,





More information about the llvm-commits mailing list