Enabled the new PyAuto test on the build bot.

BUG=
TEST=

Review URL: https://webrtc-codereview.appspot.com/520003

git-svn-id: http://webrtc.googlecode.com/svn/trunk@2116 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
phoglund@webrtc.org 2012-04-25 10:11:55 +00:00
parent d18dd6dc7e
commit 6a65cfbb0e
2 changed files with 34 additions and 9 deletions

View File

@ -127,6 +127,12 @@ VALGRIND_DISABLED_TESTS = [
'test_fec', # Too slow for Valgrind
]
# These must run in a Chrome checkout.
CHROME_WEBRTC_TESTS = {
# Test name Linux Mac Windows
'chrome/test/functional/webrtc_call.py': (True, True, True),
}
linux_normal_tests = utils.GetEnabledTests(NORMAL_TESTS, 'Linux')
mac_normal_tests = utils.GetEnabledTests(NORMAL_TESTS, 'Mac')
windows_normal_tests = utils.GetEnabledTests(NORMAL_TESTS, 'Windows')
@ -137,6 +143,7 @@ mac_physical_machine_tests = utils.GetEnabledTests(PHYSICAL_MACHINE_TESTS,
'Mac')
windows_physical_machine_tests = utils.GetEnabledTests(PHYSICAL_MACHINE_TESTS,
'Windows')
linux_chrome_webrtc_tests = utils.GetEnabledTests(CHROME_WEBRTC_TESTS, 'Linux')
####### FACTORIES
# Linux
@ -190,6 +197,7 @@ linux_chrome_factory = utils.WebRTCChromeFactory(
custom_deps_list=CHROME_CUSTOM_DEPS_LIST,
safesync_url=CHROME_LKGR_URL)
linux_chrome_factory.EnableBuild()
linux_chrome_factory.EnableTests(linux_chrome_webrtc_tests)
linux_chrome_bloat_factory = utils.WebRTCChromeFactory(
utils.BuildStatusOracle('linux_chrome_bloat'),

View File

@ -212,7 +212,7 @@ class WebRTCFactory(factory.BuildFactory):
default behavior, which is to just run the binary specified in
test without arguments.
"""
pass
raise NotImplementedError('Must be overridden')
def EnableTest(self, test):
"""Makes a test run in the build sequence. May be overridden.
@ -525,10 +525,11 @@ class WebRTCChromeFactory(WebRTCFactory):
descriptor="gyp_chromium",
warn_on_failure=True, workdir='build/src')
chrome_targets = ['chrome', 'pyautolib']
if release:
self.AddCommonMakeStep('chrome', 'BUILDTYPE=Release')
self.AddCommonMakeStep(chrome_targets, 'BUILDTYPE=Release')
else:
self.AddCommonMakeStep('chrome')
self.AddCommonMakeStep(chrome_targets)
self.build_enabled = True
self.release = release
@ -556,14 +557,28 @@ class WebRTCChromeFactory(WebRTCFactory):
warn_on_failure=True, workdir='build/src',
timeout=7200)
def AddCommonMakeStep(self, target, make_extra=None):
descriptor = ['make ' + target]
cmd = ['make', target, '-j100']
def AddCommonMakeStep(self, targets, make_extra=None):
descriptor = ['make'] + targets
cmd = ['make', '-j100'] + targets
if make_extra is not None:
cmd.append(make_extra)
self.AddCommonStep(cmd=cmd, descriptor=descriptor,
warn_on_failure=True, workdir='build/src')
def AddCommonTestRunStep(self, test):
# We currently only support PyAuto tests on this bot.
self._AddPyAutoTestRunStep(test)
def _AddPyAutoTestRunStep(self, test):
assert self.build_enabled
# Set up the test under Xvfb since it will probably launch browser windows.
# Replace any slashes in the test's path with underscores for the name since
# the buildbot web pages will become confused otherwise.
descriptor = test.replace('/', '_')
pyauto_flags = ' --chrome-flags --enable-media-stream'
cmd = MakeCommandToRunTestInXvfb(test + pyauto_flags)
self.AddCommonStep(cmd=cmd, descriptor=descriptor, workdir='build/src')
class WebRTCLinuxFactory(WebRTCFactory):
"""Sets up the Linux build.
@ -646,9 +661,7 @@ class WebRTCLinuxFactory(WebRTCFactory):
def AddXvfbTestRunStep(self, test_name, test_binary, test_arguments=''):
""" Adds a test to be run inside a XVFB window manager."""
cmd = ('xvfb-run '
'--server-args="-screen 0 800x600x24 -extension Composite" '
'%s %s' % (test_binary, test_arguments))
cmd = MakeCommandToRunTestInXvfb("%s %s" % (test_binary, test_arguments))
self.AddCommonTestRunStep(test=test_name, cmd=cmd)
def AddCommonMakeStep(self, target, extra_text=None, make_extra=None):
@ -923,6 +936,10 @@ def PosixPathJoin(*args):
def WindowsPathJoin(*args):
return ntpath.normpath(ntpath.join(*args))
def MakeCommandToRunTestInXvfb(cmd):
return ('xvfb-run --server-args="-screen 0 800x600x24 -extension Composite" '
'%s' % cmd)
class UnsupportedConfigurationError(Exception):
pass