Skip to content
This repository has been archived by the owner on Sep 15, 2021. It is now read-only.

Commit

Permalink
Merge default -> production
Browse files Browse the repository at this point in the history
--HG--
branch : production
  • Loading branch information
ahal committed Mar 25, 2013
2 parents 755a167 + 25a279b commit c690cf2
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 2 deletions.
1 change: 1 addition & 0 deletions configs/b2g/emulator_automation_config.py
Expand Up @@ -27,4 +27,5 @@
'run-tests', 'run-tests',
], ],
"download_symbols": "ondemand", "download_symbols": "ondemand",
"download_minidump_stackwalk": True,
} }
30 changes: 30 additions & 0 deletions mozharness/mozilla/testing/testbase.py
Expand Up @@ -66,6 +66,7 @@ class TestingMixin(VirtualenvMixin, BuildbotMixin):
test_zip_path = None test_zip_path = None
symbols_url = None symbols_url = None
symbols_path = None symbols_path = None
default_tools_repo = 'http://hg.mozilla.org/build/tools'


def query_symbols_url(self): def query_symbols_url(self):
if self.symbols_url: if self.symbols_url:
Expand Down Expand Up @@ -261,6 +262,35 @@ def install(self):
# TODO we'll need some error checking here # TODO we'll need some error checking here
self.binary_path = self.get_output_from_command(cmd, halt_on_failure=True) self.binary_path = self.get_output_from_command(cmd, halt_on_failure=True)


def install_minidump_stackwalk(self):
dirs = self.query_abs_dirs()

if not os.path.isdir(os.path.join(dirs['abs_work_dir'], 'tools', 'breakpad')):
# clone hg.m.o/build/tools
repos = [{
'repo': self.config.get('tools_repo') or self.default_tools_repo,
'vcs': 'hg',
'dest': os.path.join(dirs['abs_work_dir'], "tools")
}]
self.vcs_checkout(**repos[0])

# find binary for platform/architecture
path = os.path.join(dirs['abs_work_dir'], 'tools', 'breakpad', '%s', 'minidump_stackwalk')
pltfrm = platform.platform().lower()
arch = platform.architecture()
if 'linux' in pltfrm:
if '64' in arch:
return path % 'linux64'
return path % 'linux'
if any(s in pltfrm for s in ('mac', 'osx', 'darwin')):
if '64' in arch:
return path % 'osx64'
return path % 'osx'
if 'win' in pltfrm:
return path % 'win32' + '.exe'

self.fatal("Could not find a minidump_stackwalk binary for this platform!")

def _run_cmd_checks(self, suites): def _run_cmd_checks(self, suites):
if not suites: if not suites:
return return
Expand Down
13 changes: 11 additions & 2 deletions scripts/b2g_emulator_unittest.py
Expand Up @@ -16,6 +16,7 @@
from mozharness.base.errors import BaseErrorList from mozharness.base.errors import BaseErrorList
from mozharness.base.log import ERROR from mozharness.base.log import ERROR
from mozharness.base.script import BaseScript from mozharness.base.script import BaseScript
from mozharness.base.vcs.vcsbase import VCSMixin
from mozharness.mozilla.testing.errors import LogcatErrorList from mozharness.mozilla.testing.errors import LogcatErrorList
from mozharness.mozilla.testing.testbase import TestingMixin, testing_config_options from mozharness.mozilla.testing.testbase import TestingMixin, testing_config_options
from mozharness.mozilla.testing.unittest import DesktopUnittestOutputParser, EmulatorMixin from mozharness.mozilla.testing.unittest import DesktopUnittestOutputParser, EmulatorMixin
Expand All @@ -40,7 +41,7 @@ def parse_single_line(self, line):
super(MarionetteUnittestOutputParser, self).parse_single_line(line) super(MarionetteUnittestOutputParser, self).parse_single_line(line)




class B2GEmulatorTest(TestingMixin, TooltoolMixin, EmulatorMixin, BaseScript): class B2GEmulatorTest(TestingMixin, TooltoolMixin, EmulatorMixin, VCSMixin, BaseScript):
test_suites = ('reftest', 'mochitest', 'xpcshell', 'crashtest') test_suites = ('reftest', 'mochitest', 'xpcshell', 'crashtest')
config_options = [ config_options = [
[["--type"], [["--type"],
Expand Down Expand Up @@ -152,6 +153,7 @@ def __init__(self, require_config_file=False):
self.test_url = c.get('test_url') self.test_url = c.get('test_url')
self.test_manifest = c.get('test_manifest') self.test_manifest = c.get('test_manifest')
self.busybox_path = None self.busybox_path = None
self.minidump_stackwalk_path = None


# TODO detect required config items and fail if not set # TODO detect required config items and fail if not set


Expand Down Expand Up @@ -194,6 +196,8 @@ def download_and_extract(self):
super(B2GEmulatorTest, self).download_and_extract() super(B2GEmulatorTest, self).download_and_extract()
dirs = self.query_abs_dirs() dirs = self.query_abs_dirs()
self.install_emulator() self.install_emulator()
if self.config.get('download_minidump_stackwalk'):
self.minidump_stackwalk_path = self.install_minidump_stackwalk()


self.mkdir_p(dirs['abs_xre_dir']) self.mkdir_p(dirs['abs_xre_dir'])
self._download_unzip(self.config['xre_url'], self._download_unzip(self.config['xre_url'],
Expand Down Expand Up @@ -345,14 +349,19 @@ def run_tests(self):
if suite_name == 'xpcshell': if suite_name == 'xpcshell':
success_codes = [0, 1] success_codes = [0, 1]


env = {}
if self.minidump_stackwalk_path:
env['MINIDUMP_STACKWALK'] = self.minidump_stackwalk_path
env = self.query_env(partial_env=env)

for i in range(0, 5): for i in range(0, 5):
# We retry the run because sometimes installing gecko on the # We retry the run because sometimes installing gecko on the
# emulator can cause B2G not to restart properly - Bug 812935. # emulator can cause B2G not to restart properly - Bug 812935.
parser = MarionetteUnittestOutputParser(suite_category=suite_name, parser = MarionetteUnittestOutputParser(suite_category=suite_name,
config=self.config, config=self.config,
log_obj=self.log_obj, log_obj=self.log_obj,
error_list=error_list) error_list=error_list)
return_code = self.run_command(cmd, cwd=cwd, return_code = self.run_command(cmd, cwd=cwd, env=env,
output_parser=parser, output_parser=parser,
success_codes=success_codes) success_codes=success_codes)
if not parser.install_gecko_failed: if not parser.install_gecko_failed:
Expand Down

0 comments on commit c690cf2

Please sign in to comment.