# HG changeset patch # User Jeff Hammel # Date 1343153527 25200 # Node ID ef8590b55605a86f159ff1fe0beeac544ea1afc9 # Parent 0d5cd3dccbec8c98c970a851c963ceeb56ce43e3 determine actually correct name extension diff -r 0d5cd3dccbec -r ef8590b55605 talosnames/templates/index.html --- a/talosnames/templates/index.html Mon Jul 23 16:09:44 2012 -0700 +++ b/talosnames/templates/index.html Tue Jul 24 11:12:07 2012 -0700 @@ -27,8 +27,6 @@ .header { font-weight: bold; -align: center; -text-align: center; } .tbpl_initial { @@ -117,8 +115,8 @@ {{suite}} {{list2cmdline(commands[suite])}} {{tbpl[suite]}} - {{paint.get(suite, '')}} - {{chrome.get(suite, '')}} + {{paint.get(suite, '')}} + {{chrome.get(suite, '')}} {{if tests.get(suite)}} @@ -130,6 +128,7 @@ {{for test in sorted(tests[suite].keys())}}
+ {{test_type[suite][test]}}
{{test}}
{{for attr in sorted(tests.get(suite, {})[test].keys())}} diff -r 0d5cd3dccbec -r ef8590b55605 talosnames/web.py --- a/talosnames/web.py Mon Jul 23 16:09:44 2012 -0700 +++ b/talosnames/web.py Tue Jul 24 11:12:07 2012 -0700 @@ -7,6 +7,7 @@ import optparse import os import pprint +import talos.test import tempita from api import TalosNames from subprocess import list2cmdline @@ -42,6 +43,7 @@ paint = {} chrome = {} graphserver = {} + test_type = {} for suite in suites: for test in tests.get(suite) or []: config = self.api.talos_config(suite) @@ -58,8 +60,20 @@ paint[suite] = _paint chrome[suite] = _chrome + # determine test extension + # TODO: move this to api.py + testname = test + testobj = talos.test.test_dict[testname] + if issubclass(testobj, talos.test.TsBase): + test_type.setdefault(suite, {})[test] = 'Startup Test' + elif issubclass(testobj, talos.test.PageloaderTest): + test_type.setdefault(suite, {})[test] = 'Page Load Test' + testname += extension + else: + raise Exception + # get graphserver data - names = self.api.graphserver_name(test + extension) + names = self.api.graphserver_name(testname) if names: graphserver.setdefault(suite, {})[test] = [names] else: @@ -67,6 +81,7 @@ self.data['graphserver'] = graphserver self.data['paint'] = paint self.data['chrome'] = chrome + self.data['test_type'] = test_type def __call__(self, environ, start_response): request = Request(environ) @@ -82,11 +97,22 @@ if __name__ == '__main__': parser = optparse.OptionParser() + parser.add_option('-o', '--output', dest='output', + help="file to output to") + parser.add_option('-p', '--port', dest='port', + default=8080, type='int', + help="port to serve on") options, args = parser.parse_args() - from wsgiref import simple_server app = Handler() - server = simple_server.make_server(host='0.0.0.0', port=8080, app=app) - server.serve_forever() + + if options.output: + f = file(options.output, 'w') + f.write(app.render()) + f.close() + else: + from wsgiref import simple_server + server = simple_server.make_server(host='0.0.0.0', port=options.port, app=app) + server.serve_forever()