changeset 16:1713b3e244a7

add some things
author Jeff Hammel <jhammel@mozilla.com>
date Tue, 10 Jul 2012 18:18:42 -0700
parents 2fc6c53931a1
children 25e91fc7ff01
files setup.py talosnames/api.py talosnames/main.py
diffstat 3 files changed, 16 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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 = {}
--- 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 = []
--- 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)