comparison talosnames/api.py @ 17:25e91fc7ff01

getting the test config now works
author Jeff Hammel <jhammel@mozilla.com>
date Tue, 10 Jul 2012 18:23:16 -0700
parents 1713b3e244a7
children 48b4c926be73
comparison
equal deleted inserted replaced
16:1713b3e244a7 17:25e91fc7ff01
39 39
40 def __init__(self): 40 def __init__(self):
41 self.setup_database() 41 self.setup_database()
42 self.tbpl_mapping() 42 self.tbpl_mapping()
43 self.setup_buildbot() 43 self.setup_buildbot()
44 self._talos_configs = {}
44 45
45 def setup_database(self): 46 def setup_database(self):
46 self.db = sqlite3.connect(':memory:') 47 self.db = sqlite3.connect(':memory:')
47 sql_lines = urllib2.urlopen(self.graphserver_sql).readlines() 48 sql_lines = urllib2.urlopen(self.graphserver_sql).readlines()
48 49
111 command += ['-o', outfile] # add an output file 112 command += ['-o', outfile] # add an output file
112 command += ['-e', sys.executable] # add a pretend firefox so PerfConfigurator won't whine 113 command += ['-e', sys.executable] # add a pretend firefox so PerfConfigurator won't whine
113 call(['PerfConfigurator'] + command, stdout=subprocess.PIPE, cwd=talos_dir) 114 call(['PerfConfigurator'] + command, stdout=subprocess.PIPE, cwd=talos_dir)
114 assert os.path.exists(outfile) 115 assert os.path.exists(outfile)
115 config = yaml.load(file(outfile)) 116 config = yaml.load(file(outfile))
117 return config
118
119 def test_config(self, name):
120 test_config = self.talos_config(name)['tests']
121 retval = {}
122 for test in test_config:
123 name = test.pop('name')
124 retval[name] = test
125 return retval
116 126
117 def __call__(self, name=None): 127 def __call__(self, name=None):
118 retval = [] 128 retval = []
119 for short_name, graphserver_name in self.names.items(): 129 for short_name, graphserver_name in self.names.items():
120 if (name is None) or (name == short_name or short_name.startswith(name + '_')): 130 if (name is None) or (name == short_name or short_name.startswith(name + '_')):