Bug 849270 - Add --symbols-path to marionette test runner, r=jgriffin
authorAndrew Halberstadt <ahalberstadt@mozilla.com>
Tue, 02 Apr 2013 11:19:15 -0400
changeset 126947 28c2fb26277286c38c669f657ed3acb25ceedd66
parent 126946 9f333a9c1dc0005d89ee2bd81a7c2be7d51e0c15
child 126948 90aa2c55421cddac896164ef188755a2ea6014e4
push id24499
push userryanvm@gmail.com
push dateWed, 03 Apr 2013 02:25:10 +0000
treeherdermozilla-central@97cfc16ba5dc [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjgriffin
bugs849270
milestone23.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 849270 - Add --symbols-path to marionette test runner, r=jgriffin
testing/marionette/client/marionette/b2ginstance.py
testing/marionette/client/marionette/runtests.py
--- a/testing/marionette/client/marionette/b2ginstance.py
+++ b/testing/marionette/client/marionette/b2ginstance.py
@@ -110,22 +110,20 @@ class B2GInstance(object):
         local_profiles_ini = tempfile.NamedTemporaryFile()
         self.dm.getFile(remote_profiles_ini, local_profiles_ini.name)
         cfg = ConfigParser()
         cfg.readfp(local_profiles_ini)
 
         remote_profiles = []
         for section in cfg.sections():
             if cfg.has_option(section, 'Path'):
-                is_relative = 0
-                if cfg.has_option(section, 'IsRelative'):
-                    is_relative = cfg.getint(section, 'IsRelative')
-
-                remote_profiles.append(posixpath.join(remote_profiles_ini, cfg.get(section, 'Path'))
-                                        if is_relative else cfg.get(section, 'Path'))
+                if cfg.has_option(section, 'IsRelative') and cfg.getint(section, 'IsRelative'):
+                    remote_profiles.append(posixpath.join(posixpath.dirname(remote_profiles_ini), cfg.get(section, 'Path')))
+                else:
+                    remote_profiles.append(cfg.get(section, 'Path'))
         return remote_profiles
 
     def check_for_crashes(self, symbols_path):
         remote_dump_dirs = [posixpath.join(p, 'minidumps') for p in self.check_remote_profiles()]
         crashed = False
         for remote_dump_dir in remote_dump_dirs:
             print "checking for crashes in '%s'" % remote_dump_dir
             local_dump_dir = tempfile.mkdtemp()
--- a/testing/marionette/client/marionette/runtests.py
+++ b/testing/marionette/client/marionette/runtests.py
@@ -7,16 +7,17 @@ import imp
 import inspect
 import logging
 from optparse import OptionParser
 import os
 import unittest
 import socket
 import sys
 import time
+import traceback
 import platform
 import moznetwork
 import xml.dom.minidom as dom
 
 from manifestparser import TestManifest
 from mozhttpd import MozHttpd
 
 from marionette import Marionette
@@ -181,17 +182,18 @@ class MarionetteTextTestRunner(unittest.
 class MarionetteTestRunner(object):
 
     def __init__(self, address=None, emulator=None, emulatorBinary=None,
                  emulatorImg=None, emulator_res='480x800', homedir=None,
                  bin=None, profile=None, autolog=False, revision=None,
                  es_server=None, rest_server=None, logger=None,
                  testgroup="marionette", noWindow=False, logcat_dir=None,
                  xml_output=None, repeat=0, perf=False, perfserv=None,
-                 gecko_path=None, testvars=None, tree=None, device=None):
+                 gecko_path=None, testvars=None, tree=None, device=None,
+                 symbols_path=None):
         self.address = address
         self.emulator = emulator
         self.emulatorBinary = emulatorBinary
         self.emulatorImg = emulatorImg
         self.emulator_res = emulator_res
         self.homedir = homedir
         self.bin = bin
         self.profile = profile
@@ -210,16 +212,17 @@ class MarionetteTestRunner(object):
         self.xml_output = xml_output
         self.repeat = repeat
         self.perf = perf
         self.perfserv = perfserv
         self.gecko_path = gecko_path
         self.testvars = {}
         self.tree = tree
         self.device = device
+        self.symbols_path = symbols_path
 
         if testvars:
             if not os.path.exists(testvars):
                 raise Exception('--testvars file does not exist')
 
             import json
             with open(testvars) as f:
                 self.testvars = json.loads(f.read())
@@ -278,32 +281,34 @@ class MarionetteTestRunner(object):
             host, port = self.address.split(':')
             if self.emulator:
                 self.marionette = Marionette.getMarionetteOrExit(
                                              host=host, port=int(port),
                                              connectToRunningEmulator=True,
                                              homedir=self.homedir,
                                              baseurl=self.baseurl,
                                              logcat_dir=self.logcat_dir,
-                                             gecko_path=self.gecko_path)
+                                             gecko_path=self.gecko_path,
+                                             symbols_path=self.symbols_path)
             else:
                 self.marionette = Marionette(host=host,
                                              port=int(port),
                                              baseurl=self.baseurl)
         elif self.emulator:
             self.marionette = Marionette.getMarionetteOrExit(
                                          emulator=self.emulator,
                                          emulatorBinary=self.emulatorBinary,
                                          emulatorImg=self.emulatorImg,
                                          emulator_res=self.emulator_res,
                                          homedir=self.homedir,
                                          baseurl=self.baseurl,
                                          noWindow=self.noWindow,
                                          logcat_dir=self.logcat_dir,
-                                         gecko_path=self.gecko_path)
+                                         gecko_path=self.gecko_path,
+                                         symbols_path=self.symbols_path)
         else:
             raise Exception("must specify binary, address or emulator")
 
     def post_to_autolog(self, elapsedtime):
         self.logger.info('posting results to autolog')
 
         logfile = None
         if self.emulator:
@@ -350,16 +355,21 @@ class MarionetteTestRunner(object):
         while self.repeat >=0:
             for test in tests:
                 self.run_test(test, testtype)
             self.repeat -= 1
         self.logger.info('\nSUMMARY\n-------')
         self.logger.info('passed: %d' % self.passed)
         self.logger.info('failed: %d' % self.failed)
         self.logger.info('todo: %d' % self.todo)
+        try:
+            self.marionette.check_for_crash()
+        except:
+            traceback.print_exc()
+
         self.elapsedtime = datetime.utcnow() - starttime
         if self.autolog:
             self.post_to_autolog(self.elapsedtime)
         if self.perfrequest and options.perf:
             try:
                 self.perfrequest.submit()
             except Exception, e:
                 print "Could not submit to datazilla"
@@ -631,16 +641,20 @@ def parse_options():
                       help='path to B2G gecko binaries that should be '
                       'installed on the device or emulator')
     parser.add_option('--testvars', dest='testvars', action='store',
                       default=None,
                       help='path to a JSON file with any test data required')
     parser.add_option('--tree', dest='tree', action='store',
                       default='b2g',
                       help='the tree that the revsion parameter refers to')
+    parser.add_option('--symbols-path', dest='symbols_path', action='store',
+                      default=None,
+                      help='absolute path to directory containing breakpad '
+                      'symbols, or the URL of a zip file containing symbols')
 
     options, tests = parser.parse_args()
 
     if not tests:
         parser.print_usage()
         parser.exit()
 
     if not options.emulator and not options.address and not options.bin:
@@ -685,17 +699,18 @@ def startTestRunner(runner_class, option
                           tree=options.tree,
                           autolog=options.autolog,
                           xml_output=options.xml_output,
                           repeat=options.repeat,
                           perf=options.perf,
                           perfserv=options.perfserv,
                           gecko_path=options.gecko_path,
                           testvars=options.testvars,
-                          device=options.device)
+                          device=options.device,
+                          symbols_path=options.symbols_path)
     runner.run_tests(tests, testtype=options.type)
     return runner
 
 def cli(runner_class=MarionetteTestRunner):
     options, tests = parse_options()
     runner = startTestRunner(runner_class, options, tests)
     if runner.failed > 0:
         sys.exit(10)