[llvm-commits] [zorg] r99154 - in /zorg/trunk/lnt: lnt/__init__.py lnt/import/ImportData lnt/import/NTAuxSubmit lnt/import/NTEmailReport.py lnt/import/NightlytestReader.py lnt/import/ServerUtil.py lnt/import/SubmitData lnt/viewer/Config.py lnt/viewer/NTStyleBrowser.ptl lnt/viewer/machines.ptl lnt/viewer/nightlytest.ptl lnt/viewer/root.ptl lnt/viewer/runs.ptl lnt/viewer/tests.ptl lnt/viewer/zview/zviewui.ptl setup.py

Daniel Dunbar daniel at zuster.org
Sun Mar 21 17:55:22 PDT 2010


Author: ddunbar
Date: Sun Mar 21 19:55:22 2010
New Revision: 99154

URL: http://llvm.org/viewvc/llvm-project?rev=99154&view=rev
Log:
LNT: Scrub a bunch of the code -- formatting fixes, docstrings, add fixmes, fix comments, etc.

Modified:
    zorg/trunk/lnt/lnt/__init__.py
    zorg/trunk/lnt/lnt/import/ImportData
    zorg/trunk/lnt/lnt/import/NTAuxSubmit
    zorg/trunk/lnt/lnt/import/NTEmailReport.py
    zorg/trunk/lnt/lnt/import/NightlytestReader.py
    zorg/trunk/lnt/lnt/import/ServerUtil.py
    zorg/trunk/lnt/lnt/import/SubmitData
    zorg/trunk/lnt/lnt/viewer/Config.py
    zorg/trunk/lnt/lnt/viewer/NTStyleBrowser.ptl
    zorg/trunk/lnt/lnt/viewer/machines.ptl
    zorg/trunk/lnt/lnt/viewer/nightlytest.ptl
    zorg/trunk/lnt/lnt/viewer/root.ptl
    zorg/trunk/lnt/lnt/viewer/runs.ptl
    zorg/trunk/lnt/lnt/viewer/tests.ptl
    zorg/trunk/lnt/lnt/viewer/zview/zviewui.ptl
    zorg/trunk/lnt/setup.py

Modified: zorg/trunk/lnt/lnt/__init__.py
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/lnt/lnt/__init__.py?rev=99154&r1=99153&r2=99154&view=diff
==============================================================================
--- zorg/trunk/lnt/lnt/__init__.py (original)
+++ zorg/trunk/lnt/lnt/__init__.py Sun Mar 21 19:55:22 2010
@@ -1 +1,6 @@
+__author__ = 'Daniel Dunbar'
+__email__ = 'daniel at zuster.org'
+__versioninfo__ = (0, 3, 0)
+__version__ = '.'.join(map(str, __versioninfo__))
+
 __all__ = []

Modified: zorg/trunk/lnt/lnt/import/ImportData
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/lnt/lnt/import/ImportData?rev=99154&r1=99153&r2=99154&view=diff
==============================================================================
--- zorg/trunk/lnt/lnt/import/ImportData (original)
+++ zorg/trunk/lnt/lnt/import/ImportData Sun Mar 21 19:55:22 2010
@@ -1,5 +1,11 @@
 #!/usr/bin/env python
 
+"""
+Generic script for importing LNT test data into a database.
+"""
+
+# FIXME: Roll this into lnttool and kill.
+
 import os
 import plistlib
 import sys

Modified: zorg/trunk/lnt/lnt/import/NTAuxSubmit
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/lnt/lnt/import/NTAuxSubmit?rev=99154&r1=99153&r2=99154&view=diff
==============================================================================
--- zorg/trunk/lnt/lnt/import/NTAuxSubmit (original)
+++ zorg/trunk/lnt/lnt/import/NTAuxSubmit Sun Mar 21 19:55:22 2010
@@ -1,5 +1,15 @@
 #!/usr/bin/env python
 
+"""
+Command line tool for submitting to a LNT server.
+
+This script is explicitly designed to work with llvm/utils/NewNightlyTest.pl's
+-submit-aux argument. It simply converts the data and submits it to the llvm.org
+nightly test server.
+"""
+
+# FIXME: Roll into lnttool and kill.
+
 import sys
 import NightlytestReader
 import ServerUtil
@@ -16,7 +26,7 @@
     # instances of the LNT infrastructure to default to the correct server for
     # their installation.
     parser.add_option("", "--server", dest="serverUrl", type=str,
-                      default="http://llvm.org/perf/db_nt_internal/submitRun")
+                      default="http://llvm.org/perf/db_default/submitRun")
 
     opts,args = parser.parse_args()
 

Modified: zorg/trunk/lnt/lnt/import/NTEmailReport.py
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/lnt/lnt/import/NTEmailReport.py?rev=99154&r1=99153&r2=99154&view=diff
==============================================================================
--- zorg/trunk/lnt/lnt/import/NTEmailReport.py (original)
+++ zorg/trunk/lnt/lnt/import/NTEmailReport.py Sun Mar 21 19:55:22 2010
@@ -1,5 +1,11 @@
 #!/usr/bin/python
 
+"""
+Command line tool for sending an LNT email report.
+"""
+
+# FIXME: Roll into lnttool or just kill?
+
 import os
 import smtplib
 import sys

Modified: zorg/trunk/lnt/lnt/import/NightlytestReader.py
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/lnt/lnt/import/NightlytestReader.py?rev=99154&r1=99153&r2=99154&view=diff
==============================================================================
--- zorg/trunk/lnt/lnt/import/NightlytestReader.py (original)
+++ zorg/trunk/lnt/lnt/import/NightlytestReader.py Sun Mar 21 19:55:22 2010
@@ -1,5 +1,12 @@
 #!/usr/bin/env python
 
+"""
+Data converter from the llvm/utils/NewNightlyTest.pl report file format
+(*-sentdata.txt) to the LNT plist format.
+"""
+
+# FIXME: Refactor data conversion code.
+
 import re
 
 kDataKeyStart = re.compile('(.*)  =>(.*)')

Modified: zorg/trunk/lnt/lnt/import/ServerUtil.py
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/lnt/lnt/import/ServerUtil.py?rev=99154&r1=99153&r2=99154&view=diff
==============================================================================
--- zorg/trunk/lnt/lnt/import/ServerUtil.py (original)
+++ zorg/trunk/lnt/lnt/import/ServerUtil.py Sun Mar 21 19:55:22 2010
@@ -1,3 +1,7 @@
+"""
+Utility for submitting files to a web server over HTTP.
+"""
+
 import plistlib
 import urllib
 import urllib2

Modified: zorg/trunk/lnt/lnt/import/SubmitData
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/lnt/lnt/import/SubmitData?rev=99154&r1=99153&r2=99154&view=diff
==============================================================================
--- zorg/trunk/lnt/lnt/import/SubmitData (original)
+++ zorg/trunk/lnt/lnt/import/SubmitData Sun Mar 21 19:55:22 2010
@@ -1,5 +1,11 @@
 #!/usr/bin/python
 
+"""
+Command line utility for submitting an LNT plist file to a LNT server.
+"""
+
+# FIXME: Roll into lnttool and kill. See also refactor conversion code.
+
 import ServerUtil
 
 def main():

Modified: zorg/trunk/lnt/lnt/viewer/Config.py
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/lnt/lnt/viewer/Config.py?rev=99154&r1=99153&r2=99154&view=diff
==============================================================================
--- zorg/trunk/lnt/lnt/viewer/Config.py (original)
+++ zorg/trunk/lnt/lnt/viewer/Config.py Sun Mar 21 19:55:22 2010
@@ -1,3 +1,7 @@
+"""
+LNT Config object for tracking user-configurable installation parameters.
+"""
+
 import os
 
 class DBInfo:

Modified: zorg/trunk/lnt/lnt/viewer/NTStyleBrowser.ptl
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/lnt/lnt/viewer/NTStyleBrowser.ptl?rev=99154&r1=99153&r2=99154&view=diff
==============================================================================
--- zorg/trunk/lnt/lnt/viewer/NTStyleBrowser.ptl (original)
+++ zorg/trunk/lnt/lnt/viewer/NTStyleBrowser.ptl Sun Mar 21 19:55:22 2010
@@ -1,5 +1,13 @@
 # -*- python -*-
 
+"""
+Base UI object for implementing an LNT "nightlytest" style browser of test
+results.
+
+This relies on naming conventions amongst the tests to infer the structure, and
+provide a GUI similar to the old nightly test infrastructure.
+"""
+
 import re
 
 import quixote
@@ -20,7 +28,10 @@
             raise TraversalError(str(exc))
 
     def getActiveRun(self, db):
-        # Check for overrides
+        # Check for overrides.
+        #
+        # FIXME: This is broken, and breaks down in places. We need to redirect
+        # properly.
         request = quixote.get_request()
         id = self.id
         run_id = request.form.get('run', '')
@@ -44,7 +55,7 @@
         # Find previous runs, ordered by time.
         runs = db.runs(run.machine).order_by(Run.start_time.desc()).all()
 
-        # Find previous run to compare to
+        # Find previous run to compare to.
         if compareTo is None:
             for r in runs:
                 # FIXME: Compare revisions, not times.
@@ -70,7 +81,7 @@
                     infoPredicates.append((name,
                                            lambda t,k,v,p=pattern: p.search(v)))
 
-        # Compare the summary information
+        # Compare the summary information.
         summary = RunSummary()
         summary.addRun(db, run, testPredicate, infoPredicates)
         if compareTo:
@@ -95,7 +106,7 @@
         form.add_submit("submit", "Update")
         Util.addOtherFormValues(form)
 
-        # Get a DB connection
+        # Get a DB connection.
         db = self.root.getDB()
         run,runs,compareTo = self.getInfo(db)
         machine = run.machine
@@ -113,7 +124,8 @@
               <td align=right>Run:</td>
               <td>%s</td>
             </tr>
-        """ % (self.getHeaderTitle(), machine.name, machine.number, run.start_time)
+        """ % (self.getHeaderTitle(), machine.name, machine.number,
+               run.start_time)
         if compareTo:
             """
             <tr>
@@ -127,7 +139,7 @@
         <p>
         """
 
-        # Hide by default unless filled in
+        # Show filtering options, hidden by default unless filled in.
         hidden = True
         for w in form.get_all_widgets():
             if isinstance(w, (quixote.form.HiddenWidget,)):
@@ -163,7 +175,8 @@
         runIndex = runs.index(run)
         for r in runs[max(0,runIndex-3):runIndex+6]:
             if r == run:
-                """ <li> <h3><a href="../%d/">%s</a></h3> """ % (r.id, r.start_time)
+                """ <li> <h3><a href="../%d/">%s</a></h3> """ % (r.id,
+                                                                 r.start_time)
             else:
                 """ <li> <a href="../%d/">%s</a> """ % (r.id, r.start_time)
 
@@ -178,7 +191,8 @@
         """ % (full,)
         for r in runs:
             """\
-        <option value="%d"%s>%s""" % (r.id, ('', ' selected')[r == run], r.start_time)
+        <option value="%d"%s>%s""" % (r.id, ('', ' selected')[r == run],
+                                      r.start_time)
 
         """
         </select>
@@ -192,8 +206,9 @@
         <select name="compare">
         """ % (full,)
         for r in runs:
+            selected = ('', ' selected')[r == compareTo]
             """\
-        <option value="%d"%s>%s</option>""" % (r.id, ('', ' selected')[r == compareTo], r.start_time)
+        <option value="%d"%s>%s</option>""" % (r.id, selected, r.start_time)
 
         """
         </select>
@@ -354,7 +369,8 @@
                 <td align=left><a href="machines/%d/">%s:%d</a></td>
                 <td><a href="%d/">View Results</a></td>
               </tr>
-            """ % (r.start_time, r.machine.id, r.machine.name, r.machine.number, r.id)
+            """ % (r.start_time, r.machine.id, r.machine.name,
+                   r.machine.number, r.id)
 
         """
               </table>

Modified: zorg/trunk/lnt/lnt/viewer/machines.ptl
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/lnt/lnt/viewer/machines.ptl?rev=99154&r1=99153&r2=99154&view=diff
==============================================================================
--- zorg/trunk/lnt/lnt/viewer/machines.ptl (original)
+++ zorg/trunk/lnt/lnt/viewer/machines.ptl Sun Mar 21 19:55:22 2010
@@ -1,5 +1,9 @@
 # -*- python -*-
 
+"""
+Generic machine browsing UI.
+"""
+
 import sys
 from quixote import get_response, redirect
 from quixote.directory import Directory
@@ -17,7 +21,7 @@
 
 
     def _q_index [html] (self):
-        # Get a DB conntection
+        # Get a DB connection.
         db = self.root.getDB()
 
         m = db.getMachine(self.id)
@@ -28,8 +32,7 @@
         <h2>Machine: %s:%d</h2>
         """ % (m.name, m.number)
 
-
-        # Machine Info
+        # Show the machine info dictionary.
         """
         <table border=1 cellborder=1>
           <tr>
@@ -48,7 +51,7 @@
         </table>
         """
 
-        # List runs
+        # List associated runs.
         """
         <h3>Associated Runs</h3>
         <table class="sortable" border=1 cellborder=1>

Modified: zorg/trunk/lnt/lnt/viewer/nightlytest.ptl
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/lnt/lnt/viewer/nightlytest.ptl?rev=99154&r1=99153&r2=99154&view=diff
==============================================================================
--- zorg/trunk/lnt/lnt/viewer/nightlytest.ptl (original)
+++ zorg/trunk/lnt/lnt/viewer/nightlytest.ptl Sun Mar 21 19:55:22 2010
@@ -1,5 +1,11 @@
 # -*- python -*-
 
+"""
+Nightly Test UI instance for actual nightly test data.
+"""
+
+# FIXME: The NTStyleBrowser abstraction is no longer useful. We should kill it.
+
 import sys
 import time
 
@@ -109,7 +115,7 @@
         failures = Util.multidict()
         for keyname,title in kTSKeys.items():
             for testname in summary.testNames:
-                fullname = 'nightlytest.' + testname + '.' + keyname + '.success'
+                fullname = 'nightlytest.' + testname + '.' + keyname +'.success'
                 t = summary.testMap.get(str(fullname))
                 if t is None:
                     continue
@@ -122,13 +128,17 @@
     def getAllResults [html] (self, db, run, compareTo, summary):
         columns = [('GCCAS', 'gcc.compile.time', None, ()),
                    ('Bitcode','bc.compile.size', None, ()),
-                   ('LLC<br>compile','llc.compile.time', None, ('bc.compile.size',)),
-                   ('LLC-BETA<br>compile','llc-beta.compile.time', None, ('bc.compile.size',)),
-                   ('JIT<br>codegen','jit.compile.time', None, ('bc.compile.size',)),
+                   ('LLC<br>compile','llc.compile.time', None,
+                    ('bc.compile.size',)),
+                   ('LLC-BETA<br>compile','llc-beta.compile.time', None,
+                    ('bc.compile.size',)),
+                   ('JIT<br>codegen','jit.compile.time', None,
+                    ('bc.compile.size',)),
                    ('GCC','gcc.exec.time', None, ('gcc.compile.time',)),
                    ('CBE','cbe.exec.time', None, ('bc.compile.size',)),
                    ('LLC','llc.exec.time', None, ('llc.compile.time',)),
-                   ('LLC-BETA','llc-beta.exec.time', None, ('llc-beta.compile.time',)),
+                   ('LLC-BETA','llc-beta.exec.time', None,
+                    ('llc-beta.compile.time',)),
                    ('JIT','jit.exec.time', None, ('jit.compile.time',)),
                    ('GCC/CBE','gcc.exec.time','cbe.exec.time', ()),
                    ('GCC/LLC','gcc.exec.time','llc.exec.time', ()),
@@ -363,7 +373,7 @@
         full = request.form.get('full', '')
         allResults = not not full
 
-        # Get a DB connection
+        # Get a DB connection.
         db = self.root.getDB()
 
         run = self.getActiveRun(db)
@@ -515,7 +525,7 @@
         self.root.getHeader("Nightly Test Results", "../../..",
                             addPopupJS=True)
 
-        # Get a DB connection
+        # Get a DB connection.
         db = self.root.getDB()
 
         machine = db.getMachine(self.id)
@@ -683,7 +693,8 @@
         columns = [('GCCAS', 'gcc.compile.time', ()),
                    ('Bitcode','bc.compile.size', ()),
                    ('LLC<br>compile','llc.compile.time', ('bc.compile.size',)),
-                   ('LLC-BETA<br>compile','llc-beta.compile.time', ('bc.compile.size',)),
+                   ('LLC-BETA<br>compile','llc-beta.compile.time',
+                    ('bc.compile.size',)),
                    ('JIT<br>codegen','jit.compile.time', ('bc.compile.size',)),
                    ('GCC','gcc.exec.time', ('gcc.compile.time',)),
                    ('CBE','cbe.exec.time', ('bc.compile.size',)),
@@ -763,7 +774,8 @@
                     for d in dependsOn:
                         # FIXME: Make fast.
                         t = getTestNameValueInRun(db, run,
-                                                  str('nightlytest.' + testName + '.' + d))
+                                                  str('nightlytest.' + testName
+                                                      + '.' + d))
                         if t is None:
                             failed = False
                             break

Modified: zorg/trunk/lnt/lnt/viewer/root.ptl
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/lnt/lnt/viewer/root.ptl?rev=99154&r1=99153&r2=99154&view=diff
==============================================================================
--- zorg/trunk/lnt/lnt/viewer/root.ptl (original)
+++ zorg/trunk/lnt/lnt/viewer/root.ptl Sun Mar 21 19:55:22 2010
@@ -1,5 +1,9 @@
 # -*- python -*-
 
+"""
+Root LNT webapp UI.
+"""
+
 import os
 import re
 import time
@@ -18,7 +22,7 @@
     _q_exports = ["", "resources", "js", "machines", "runs", "tests",
                   "browse", "submitRun", "nightlytest", "zview",
 
-                  # Redirections,
+                  # Redirections.
                   "select_db",
 
                   ("favicon.ico", "favicon_ico")]
@@ -101,7 +105,7 @@
         else:
             """>"""
 
-        # Database selection
+        # Database selection header.
         """\
         <div class="zorg_navheader">
         <form method="get" action="%s/select_db">
@@ -157,7 +161,7 @@
         <h2>LLVM Testing DB</h2>
         """
 
-        # Features
+        # Available UIs
 
         if self.dbInfo.showNightlytest:
             """
@@ -179,14 +183,14 @@
     def browse [html] (self):
         self.getHeader("zorg", ".", addSorttableJS=False)
 
-        # Get a DB connection
+        # Get a DB connection.
         db = self.getDB()
 
         """
         <h2>LLVM Testing DB</h2>
         """
 
-        # List machines
+        # List machines.
         """
         <h3>Machines</h3>
         <table class="sortable" border=1 cellborder=1>
@@ -206,7 +210,7 @@
         </table>
         """
 
-        # List runs
+        # List runs.
         """
         <h3>Run List</h3>
         <table class="sortable" border=1 cellborder=1>
@@ -235,7 +239,7 @@
         """
 
 
-        # List tests
+        # List tests.
         """
         <h3>Test List</h3>
         <table class="sortable" border=1 cellborder=1>

Modified: zorg/trunk/lnt/lnt/viewer/runs.ptl
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/lnt/lnt/viewer/runs.ptl?rev=99154&r1=99153&r2=99154&view=diff
==============================================================================
--- zorg/trunk/lnt/lnt/viewer/runs.ptl (original)
+++ zorg/trunk/lnt/lnt/viewer/runs.ptl Sun Mar 21 19:55:22 2010
@@ -1,5 +1,9 @@
 # -*- python -*-
 
+"""
+Generic run browsing UI.
+"""
+
 import sys
 from quixote import get_response, redirect
 from quixote.directory import Directory
@@ -16,7 +20,7 @@
             raise TraversalError(str(exc))
 
     def _q_index [html] (self):
-        # Get a DB conntection
+        # Get a DB connection.
         db = self.root.getDB()
 
         r = db.getRun(self.id)
@@ -46,7 +50,7 @@
         """ % (r.machine_id, m.name, m.number, r.start_time, r.end_time)
 
 
-        # Run Info
+        # Show the run info dictionary.
         """
         <h3>Run Info</h3>
         <table border=1 cellborder=1>

Modified: zorg/trunk/lnt/lnt/viewer/tests.ptl
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/lnt/lnt/viewer/tests.ptl?rev=99154&r1=99153&r2=99154&view=diff
==============================================================================
--- zorg/trunk/lnt/lnt/viewer/tests.ptl (original)
+++ zorg/trunk/lnt/lnt/viewer/tests.ptl Sun Mar 21 19:55:22 2010
@@ -1,5 +1,9 @@
 # -*- python -*-
 
+"""
+Generic test browsing UI.
+"""
+
 import sys
 from quixote import get_response, redirect
 from quixote.directory import Directory
@@ -16,7 +20,7 @@
             raise TraversalError(str(exc))
 
     def _q_index [html] (self):
-        # Get a DB conntection
+        # Get a DB connection.
         db = self.root.getDB()
 
         t = db.getTest(self.id)
@@ -28,7 +32,7 @@
         <h2>Test: %s</h2>
         """ % (t.name,)
 
-        # Test info
+        # Show the test info dictionary.
         """
         <h3>Test Info</h3>
         <table border=1 cellborder=1>
@@ -48,7 +52,7 @@
         </table>
         """
 
-        # List samples
+        # List samples.
         """
         <h3>Associated Samples</h3>
         <table class="sortable" border=1 cellborder=1>

Modified: zorg/trunk/lnt/lnt/viewer/zview/zviewui.ptl
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/lnt/lnt/viewer/zview/zviewui.ptl?rev=99154&r1=99153&r2=99154&view=diff
==============================================================================
--- zorg/trunk/lnt/lnt/viewer/zview/zviewui.ptl (original)
+++ zorg/trunk/lnt/lnt/viewer/zview/zviewui.ptl Sun Mar 21 19:55:22 2010
@@ -1,3 +1,9 @@
+# -*- python -*-
+
+"""
+Playground for AJAXy interface to nightly test data.
+"""
+
 from quixote.directory import Directory
 from quixote.html import htmltext
 

Modified: zorg/trunk/lnt/setup.py
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/lnt/setup.py?rev=99154&r1=99153&r2=99154&view=diff
==============================================================================
--- zorg/trunk/lnt/setup.py (original)
+++ zorg/trunk/lnt/setup.py Sun Mar 21 19:55:22 2010
@@ -1,10 +1,12 @@
+import lnt
+
 from setuptools import setup, find_packages
 setup(
     name = "LNT",
-    version = "0.3",
+    version = lnt.__version__,
 
-    author = "Daniel Dunbar",
-    author_email = "daniel at zuster.org",
+    author = lnt.__author__,
+    author_email = lnt.__email__,
     url = 'http://llvm.org',
     license = 'BSD',
 





More information about the llvm-commits mailing list