changeset 26:c6a042aad739

fix some things
author Jeff Hammel <jhammel@mozilla.com>
date Thu, 12 Jul 2012 12:07:41 -0700
parents 6ec941f8704a
children ce9374c19169
files talosnames/api.py talosnames/templates/index.html talosnames/web.py
diffstat 3 files changed, 34 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/talosnames/api.py	Tue Jul 10 23:19:29 2012 -0700
+++ b/talosnames/api.py	Thu Jul 12 12:07:41 2012 -0700
@@ -135,9 +135,16 @@
         return retval
 
     def __call__(self, name=None):
+        """returns the graphserver name prefixed with `name`"""
+
         retval = []
         for short_name, graphserver_name in self.names.items():
             if (name is None) or (name == short_name or short_name.startswith(name + '_')):
                 retval.append((short_name, graphserver_name))
         retval.sort(key=lambda x: x[0])
         return retval
+
+    def graphserver_name(self, name):
+        for short_name, graphserver_name in self.names.items():
+            if name == short_name:
+                return (short_name, graphserver_name)
--- a/talosnames/templates/index.html	Tue Jul 10 23:19:29 2012 -0700
+++ b/talosnames/templates/index.html	Thu Jul 12 12:07:41 2012 -0700
@@ -36,6 +36,8 @@
   <th>Buildbot Suite</th>
   <th>Buildbot Command</th>
   <th>TBPL Name</th>
+  <th>Paint</th>
+  <th>Chrome</th>
   <th>Talos Tests</th>
 </tr>
 {{for suite in suites}}
@@ -43,6 +45,8 @@
   <td>{{suite}}</td>
   <td><tt>{{repr(commands[suite])}}</tt></td>
   <td>{{tbpl[suite]}}</td>
+  <td>{{paint[suite]}}</td>
+  <td>{{chrome[suite]}}</td>
   <td>
     {{if tests.get(suite)}}
     <table>
@@ -63,7 +67,7 @@
         </td>
         <td>
           <dl>
-            {{for name, longname in api(test)}}
+            {{for name, longname in graphserver[suite][test]}}
             <dt>{{name}}</dt>
             <dd>{{longname}}</dd>
             {{endfor}}
--- a/talosnames/web.py	Tue Jul 10 23:19:29 2012 -0700
+++ b/talosnames/web.py	Thu Jul 12 12:07:41 2012 -0700
@@ -38,6 +38,28 @@
                      'api': self.api
                      }
 
+        paint = {}
+        chrome = {}
+        graphserver = {}
+        for suite in suites:
+            for test in tests.get(suite) or []:
+                config = self.api.talos_config(suite)
+                _paint = '--mozAfterPaint' in self.data['commands'][suite]
+                _chrome = '--noChrome' not in self.data['commands'][suite]
+                extension = config.get('test_name_extension', '')
+                _extension = ''
+                if not _chrome:
+                    _extension += '_nochrome'
+                if _paint:
+                    _extension += '_paint'
+                if extension != _extension:
+                    raise AssertionError
+                paint[suite] = _paint
+                chrome[suite] = _chrome
+                graphserver.setdefault(suite, {})[test] = [self.api.graphserver_name(test + extension) or ('','')]
+        self.data['graphserver'] = graphserver
+        self.data['paint'] = paint
+        self.data['chrome'] = chrome
 
     def __call__(self, environ, start_response):
         request = Request(environ)