Mercurial > mozilla > hg > talosnames
comparison talosnames/api.py @ 16:1713b3e244a7
add some things
author | Jeff Hammel <jhammel@mozilla.com> |
---|---|
date | Tue, 10 Jul 2012 18:18:42 -0700 |
parents | 1b18b2746e69 |
children | 25e91fc7ff01 |
comparison
equal
deleted
inserted
replaced
15:2fc6c53931a1 | 16:1713b3e244a7 |
---|---|
3 import require | 3 import require |
4 import subprocess | 4 import subprocess |
5 import sqlite3 | 5 import sqlite3 |
6 import sys | 6 import sys |
7 import talos | 7 import talos |
8 import tempfile | |
8 import urllib2 | 9 import urllib2 |
10 import yaml | |
11 | |
12 try: | |
13 call = subprocess.check_call | |
14 except: | |
15 call = subprocess.call | |
9 | 16 |
10 talos_dir = os.path.dirname(os.path.abspath(talos.__file__)) | 17 talos_dir = os.path.dirname(os.path.abspath(talos.__file__)) |
11 | 18 |
12 sys.path.insert(0, os.path.dirname(os.path.abspath(__file__))) | 19 sys.path.insert(0, os.path.dirname(os.path.abspath(__file__))) |
13 | 20 |
98 | 105 |
99 def talos_config(self, name): | 106 def talos_config(self, name): |
100 """returns talos configuration for suite `name`""" | 107 """returns talos configuration for suite `name`""" |
101 command = self.buildbot_command(name) | 108 command = self.buildbot_command(name) |
102 assert command is not None, "Suite not found: %s" % name | 109 assert command is not None, "Suite not found: %s" % name |
110 outfile = tempfile.mktemp(suffix='.yml') | |
111 command += ['-o', outfile] # add an output file | |
112 command += ['-e', sys.executable] # add a pretend firefox so PerfConfigurator won't whine | |
113 call(['PerfConfigurator'] + command, stdout=subprocess.PIPE, cwd=talos_dir) | |
114 assert os.path.exists(outfile) | |
115 config = yaml.load(file(outfile)) | |
103 | 116 |
104 def __call__(self, name=None): | 117 def __call__(self, name=None): |
105 retval = [] | 118 retval = [] |
106 for short_name, graphserver_name in self.names.items(): | 119 for short_name, graphserver_name in self.names.items(): |
107 if (name is None) or (name == short_name or short_name.startswith(name + '_')): | 120 if (name is None) or (name == short_name or short_name.startswith(name + '_')): |