Bug 684081 - remove redundant code, a=testonly, DONTBUILD
authorJonathan Griffin <jgriffin@mozilla.com>
Wed, 07 Sep 2011 16:38:30 -0700
changeset 76750 cd782e4f3a1bddcacd16113cf4c1336b6f4de382
parent 76749 752ab20f2ff82b1066f595a167a81bee94ad7f67
child 76751 05c913f50c3e967da2acdcceb13013795627114c
push id21137
push userpweitershausen@mozilla.com
push dateThu, 08 Sep 2011 22:33:46 +0000
treeherdermozilla-central@41a6dc9025cb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstestonly, DONTBUILD
bugs684081
milestone9.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 684081 - remove redundant code, a=testonly, DONTBUILD
testing/tps/tps/firefoxrunner.py
testing/tps/tps/testrunner.py
--- a/testing/tps/tps/firefoxrunner.py
+++ b/testing/tps/tps/firefoxrunner.py
@@ -59,25 +59,16 @@ class TPSFirefoxRunner(object):
       self.binary = binary
     self.runner = None
     self.installdir = None
 
   def __del__(self):
     if self.installdir:
       shutil.rmtree(self.installdir, True)
 
-  @property
-  def names(self):
-      if sys.platform == 'darwin':
-          return ['firefox', 'minefield']
-      if (sys.platform == 'linux2') or (sys.platform in ('sunos5', 'solaris')):
-          return ['firefox', 'mozilla-firefox', 'minefield']
-      if os.name == 'nt' or sys.platform == 'cygwin':
-          return ['firefox']
-
   def download_build(self, installdir='downloadedbuild',
                      appname='firefox', macAppName='Minefield.app'):
     self.installdir = os.path.abspath(installdir)
     buildName = os.path.basename(self.url)
     pathToBuild = os.path.join(os.path.dirname(os.path.abspath(__file__)),
                                buildName)
 
     # delete the build if it already exists
@@ -105,38 +96,16 @@ class TPSFirefoxRunner(object):
     else:
       binary = '%s/%s/%s%s' % (installdir,
                                appname,
                                appname,
                                '.exe' if platform['name'] == 'Windows' else '')
 
     return binary
 
-  def get_respository_info(self):
-    """Read repository information from application.ini and platform.ini."""
-    import ConfigParser
-
-    config = ConfigParser.RawConfigParser()
-    dirname = os.path.dirname(self.runner.binary)
-    repository = { }
-
-    for entry in [['application', 'App'], ['platform', 'Build']]:
-        (file, section) = entry
-        config.read(os.path.join(dirname, '%s.ini' % file))
-
-        for entry in [['SourceRepository', 'repository'], ['SourceStamp', 'changeset']]:
-            (key, id) = entry
-
-            try:
-                repository['%s_%s' % (file, id)] = config.get(section, key);
-            except:
-                repository['%s_%s' % (file, id)] = None
-
-    return repository
-
   def run(self, profile=None, timeout=PROCESS_TIMEOUT, env=None, args=None):
     """Runs the given FirefoxRunner with the given Profile, waits
        for completion, then returns the process exit code
     """
     if profile is None:
       profile = Profile()
     self.profile = profile
 
--- a/testing/tps/tps/testrunner.py
+++ b/testing/tps/tps/testrunner.py
@@ -282,17 +282,20 @@ class TPSTestRunner(object):
 
     result = {
       'PASS': lambda x: ('TEST-PASS', ''),
       'FAIL': lambda x: ('TEST-UNEXPECTED-FAIL', x.rstrip()),
       'unknown': lambda x: ('TEST-UNEXPECTED-FAIL', 'test did not complete')
     } [phase.status](phase.errline)
     logstr = "\n%s | %s%s\n" % (result[0], testname, (' | %s' % result[1] if result[1] else ''))
 
-    repoinfo = self.firefoxRunner.get_respository_info()
+    try:
+      repoinfo = self.firefoxRunner.runner.get_repositoryInfo()
+    except:
+      repoinfo = {}
     apprepo = repoinfo.get('application_repository', '')
     appchangeset = repoinfo.get('application_changeset', '')
 
     # save logdata to a temporary file for posting to the db
     tmplogfile = None
     if logdata:
       tmplogfile = TempFile(prefix='tps_log_')
       tmplogfile.write(logdata)