# HG changeset patch # User Jeff Hammel # Date 1341969522 25200 # Node ID 1713b3e244a7ec497828c769aff45ef69b6f25e7 # Parent 2fc6c53931a1528443748d2e29d80e4f3bed1155 add some things diff -r 2fc6c53931a1 -r 1713b3e244a7 setup.py --- a/setup.py Tue Jul 10 18:10:39 2012 -0700 +++ b/setup.py Tue Jul 10 18:18:42 2012 -0700 @@ -5,7 +5,7 @@ import os version = "0.0" -dependencies = ['webob', 'CommandParser', 'talos', 'buildbot'] +dependencies = ['webob', 'CommandParser', 'talos', 'buildbot', 'PyYAML'] # allow use of setuptools/distribute or distutils kw = {} diff -r 2fc6c53931a1 -r 1713b3e244a7 talosnames/api.py --- a/talosnames/api.py Tue Jul 10 18:10:39 2012 -0700 +++ b/talosnames/api.py Tue Jul 10 18:18:42 2012 -0700 @@ -5,7 +5,14 @@ import sqlite3 import sys import talos +import tempfile import urllib2 +import yaml + +try: + call = subprocess.check_call +except: + call = subprocess.call talos_dir = os.path.dirname(os.path.abspath(talos.__file__)) @@ -100,6 +107,12 @@ """returns talos configuration for suite `name`""" command = self.buildbot_command(name) assert command is not None, "Suite not found: %s" % name + outfile = tempfile.mktemp(suffix='.yml') + command += ['-o', outfile] # add an output file + command += ['-e', sys.executable] # add a pretend firefox so PerfConfigurator won't whine + call(['PerfConfigurator'] + command, stdout=subprocess.PIPE, cwd=talos_dir) + assert os.path.exists(outfile) + config = yaml.load(file(outfile)) def __call__(self, name=None): retval = [] diff -r 2fc6c53931a1 -r 1713b3e244a7 talosnames/main.py --- a/talosnames/main.py Tue Jul 10 18:10:39 2012 -0700 +++ b/talosnames/main.py Tue Jul 10 18:18:42 2012 -0700 @@ -39,8 +39,9 @@ assert command is not None, "Suite not found; should be one of %s" % ', '.join(self.suites()) return subprocess.list2cmdline(command) - def tests(self): + def tests(self, suite): """return the talos test config for a buildbot suite name""" + config = self.api.talos_config(suite) def main(args=sys.argv[1:]): parser = CommandParser(TalosNamesCLI)