diff --git a/tools/.gitignore b/tools/.gitignore index 86debfda2..dd63bb2c0 100644 --- a/tools/.gitignore +++ b/tools/.gitignore @@ -38,8 +38,6 @@ twistd.pid /continuous_build/build_internal/masters/master.webrtc/android /continuous_build/build_internal/masters/master.webrtc/android-ndk /continuous_build/build_internal/masters/master.webrtc/chromeos -/continuous_build/build_internal/masters/master.webrtc/linux-chrome -/continuous_build/build_internal/masters/master.webrtc/linux-chrome-bloat /continuous_build/build_internal/masters/master.webrtc/linux-clang /continuous_build/build_internal/masters/master.webrtc/linux-slave-1 /continuous_build/build_internal/masters/master.webrtc/linux-slave-2 @@ -47,11 +45,15 @@ twistd.pid /continuous_build/build_internal/masters/master.webrtc/linux-slave-5 /continuous_build/build_internal/masters/master.webrtc/linux-slave-gcc-4.6 /continuous_build/build_internal/masters/master.webrtc/linux-valgrind +/continuous_build/build_internal/masters/master.webrtc/LinuxChrome +/continuous_build/build_internal/masters/master.webrtc/LinuxChromeBloat /continuous_build/build_internal/masters/master.webrtc/mac-slave-2 /continuous_build/build_internal/masters/master.webrtc/mac-slave-3 +/continuous_build/build_internal/masters/master.webrtc/MacChrome /continuous_build/build_internal/masters/master.webrtc/public_html /continuous_build/build_internal/masters/master.webrtc/win-32-dbg /continuous_build/build_internal/masters/master.webrtc/win-32-release +/continuous_build/build_internal/masters/master.webrtc/WinChrome /continuous_build/build_internal/masters/master.webrtc/video /continuous_build/build_internal/masters/master.tryserver.webrtc/android-trybot /continuous_build/build_internal/masters/master.tryserver.webrtc/android-ndk-trybot diff --git a/tools/DEPS b/tools/DEPS index 824dce5e8..5298e7b8e 100644 --- a/tools/DEPS +++ b/tools/DEPS @@ -34,6 +34,14 @@ deps = { "https://github.com/martine/webtreemap.git@7839cf9154", } +deps_os = { + # Statically built Xvfb to be used for browser tests on headless machines. + "unix": { + "tools/continuous_build/build/third_party/xvfb": + Var("chromium_trunk") + "/tools/third_party/xvfb", + }, +} + hooks = [ { # Update slave buildbot.tac to include WebRTC slave_utils import. diff --git a/tools/continuous_build/build_internal/masters/master.webrtc/master.cfg b/tools/continuous_build/build_internal/masters/master.webrtc/master.cfg index 0675a7c94..ac4b5244a 100755 --- a/tools/continuous_build/build_internal/masters/master.webrtc/master.cfg +++ b/tools/continuous_build/build_internal/masters/master.webrtc/master.cfg @@ -32,10 +32,8 @@ from webrtc_buildbot import utils ActiveMaster = config.Master.WebRTC ####### CHANGESOURCES -source_code_svn_url = 'http://webrtc.googlecode.com/svn/trunk' -svn_poller = SVNPoller(svnurl=source_code_svn_url, pollinterval=30, - histmax=10, svnbin='/usr/bin/svn') -c['change_source'] = svn_poller +import master_source_cfg +master_source_cfg.ConfigureChangeSource(config, c) ####### SCHEDULERS from buildbot.scheduler import Scheduler @@ -54,22 +52,13 @@ webrtc_scheduler = Scheduler(name='all', branch=None, 'LinuxVideoTest', 'Android', 'AndroidNDK', - 'ChromeOS' + 'ChromeOS', ]) -chrome_scheduler = Scheduler(name='chrome', branch=None, - builderNames=['Chrome']) - -# Run the weekend scheduler at sunday, 2 AM CST/CDT. This will mean roughly -# Sunday 9 AM in the CET timezone, which should avoid everyone's working hours. -weekend_scheduler = timed.Nightly(name='weekend', - builderNames=['ChromeBloat'], - branch=None, - dayOfWeek=6, - hour=2, - minute=0) - -c['schedulers'] = [webrtc_scheduler, chrome_scheduler, weekend_scheduler] +# Note that additional schedulers (used by the Chrome+WebRTC builders) are +# defined in master_builders_cfg.py. This is an in progress change to make all +# our bots use the Chromium Buildbot scripts. +c['schedulers'] = [webrtc_scheduler] ####### TESTS # Defines the supported tests followed by a tuple defining if the tests are @@ -125,15 +114,9 @@ PHYSICAL_MACHINE_TESTS = { VALGRIND_DISABLED_TESTS = [ 'audio_coding_module_test', # Issue 270 - 'test_fec', # Too slow for Valgrind + 'test_fec', # Too slow for Valgrind memcheck ] -# 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') @@ -144,7 +127,6 @@ 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 CHROME_SVN_URL = 'http://src.chromium.org/svn/trunk/src' @@ -199,25 +181,6 @@ chromeos_factory = utils.WebRTCLinuxFactory( chromeos_factory.EnableBuild(chrome_os=True) chromeos_factory.EnableTests(linux_normal_tests) -linux_chrome_factory = utils.WebRTCChromeFactory( - utils.BuildStatusOracle('linux_chrome'), - gclient_solution_name=CHROME_GCLIENT_SOLUTION_NAME, - svn_url=CHROME_SVN_URL, - 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'), - gclient_solution_name=CHROME_GCLIENT_SOLUTION_NAME, - svn_url=CHROME_SVN_URL, - custom_deps_list=CHROME_CUSTOM_DEPS_LIST, - safesync_url=CHROME_LKGR_URL) -linux_chrome_bloat_factory.EnableBuild(release=True, enable_profiling=True) -linux_chrome_bloat_factory.EnableBloatCalculation() - - linux_clang = utils.WebRTCLinuxFactory( utils.BuildStatusOracle('linux_clang')) linux_clang.EnableBuild(clang=True) @@ -323,18 +286,6 @@ linux_builder_video = { 'builddir': 'video', 'factory': linux_factory_video, } -linux_builder_chrome = { - 'name': 'Chrome', - 'slavename': 'webrtc-chrome', - 'builddir': 'linux-chrome', - 'factory': linux_chrome_factory, - } -linux_builder_chrome_bloat = { - 'name': 'ChromeBloat', - 'slavename': 'webrtc-chrome', - 'builddir': 'linux-chrome-bloat', - 'factory': linux_chrome_bloat_factory, - } linux_builder_clang = { 'name': 'LinuxClang', 'slavename': 'webrtc-cb-linux-slave-8', @@ -381,21 +332,26 @@ c['builders'] = [ android_builder_1, android_builder_ndk, chromeos_builder, - linux_builder_chrome, - linux_builder_chrome_bloat, ] +# Load Chrome bots that are using Chromium factories. +# These modules come from the local directory. +import master_builders_cfg +master_builders_cfg.ConfigureChromeWebRTCBuilders(c) +master_builders_cfg.ConfigureNightlyChromeWebRTCBloatBuilder(c) ####### BUILDSLAVES +# Slaves are loaded from slaves.cfg. +slaves = slaves_list.SlavesList('slaves.cfg', 'WebRTC') +for builder in c['builders']: + # Associate the slaves to the builders. The configuration is in slaves.cfg. + builder['slavenames'] = slaves.GetSlavesName(builder=builder['name']) + # The 'slaves' list defines the set of allowable buildslaves. List all the # slaves registered to a builder. Remove dupes. c['slaves'] = master_utils.AutoSetupSlaves(c['builders'], config.Master.GetBotPassword()) - -# Slaves are loaded from slaves.cfg. -slaves = slaves_list.SlavesList('slaves.cfg', 'WebRTC') - # Make sure everything works together. master_utils.VerifySetup(c, slaves) diff --git a/tools/continuous_build/build_internal/masters/master.webrtc/master_builders_cfg.py b/tools/continuous_build/build_internal/masters/master.webrtc/master_builders_cfg.py new file mode 100644 index 000000000..b4f59edf6 --- /dev/null +++ b/tools/continuous_build/build_internal/masters/master.webrtc/master_builders_cfg.py @@ -0,0 +1,95 @@ +#!/usr/bin/env python +# Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. +# +# Use of this source code is governed by a BSD-style license +# that can be found in the LICENSE file in the root of the source +# tree. An additional intellectual property rights grant can be found +# in the file PATENTS. All contributing project authors may +# be found in the AUTHORS file in the root of the source tree. + +__author__ = 'kjellander@webrtc.org (Henrik Kjellander)' + +"""Chrome+WebRTC bots configured in Chromium style.""" + +from buildbot.schedulers import timed + +from master import master_config +from webrtc_buildbot import webrtc_factory +from webrtc_buildbot import webrtc_chromium_factory + +# Used to put builders into different categories by the Helper class. +defaults = {} + + +def linux(): + return webrtc_chromium_factory.ChromiumWebRTCFactory('src/build', 'linux2') +def mac(): + return webrtc_chromium_factory.ChromiumWebRTCFactory('src/build', 'mac') +def win(): + return webrtc_chromium_factory.ChromiumWebRTCFactory('src/build', 'win32') + +CHROME_LKGR = 'http://chromium-status.appspot.com/lkgr' + + +def ConfigureChromeWebRTCBuilders(c): + helper = master_config.Helper(defaults) + B = helper.Builder + F = helper.Factory + S = helper.Scheduler + + # Main Scheduler for WebRTC + S('webrtc_rel', branch='trunk', treeStableTimer=0) + + # Set up all the builders. + # Don't put spaces or 'funny characters' within the builder names, so that + # we can safely use the builder name as part of a filepath. + + # Linux... + defaults['category'] = 'linux' + B('LinuxChrome', 'chrome_linux_debug_factory', scheduler='webrtc_rel') + F('chrome_linux_debug_factory', linux().ChromiumWebRTCLatestFactory( + target='Debug', + factory_properties={'safesync_url': CHROME_LKGR, + 'use_xvfb_on_linux': True})) + + # Mac 10.7 (Lion) ... + defaults['category'] = 'mac-10.7' + B('MacChrome', 'chrome_mac_debug_factory', scheduler='webrtc_rel') + F('chrome_mac_debug_factory', mac().ChromiumWebRTCLatestFactory( + target='Debug', + factory_properties={'safesync_url': CHROME_LKGR})) + + # Windows... + defaults['category'] = 'windows' + B('WinChrome', 'chrome_win32_debug_factory', scheduler='webrtc_rel') + F('chrome_win32_debug_factory', win().ChromiumWebRTCLatestFactory( + project=r'..\chrome\chrome.sln', + target='Debug', + factory_properties={'safesync_url': CHROME_LKGR})) + + # Use the helper class to connect the builders, factories and schedulers + # and add them to the BuildmasterConfig (c) dictionary. + helper.Update(c) + + +def ConfigureNightlyChromeWebRTCBloatBuilder(c): + # Nightly Scheduler at 2 AM CST/CDT. This will mean roughly 9 AM in the CET + # time zone, which should avoid everyone's working hours. + nightly_scheduler = timed.Nightly(name='webrtc_nightly', + branch='trunk', + builderNames=['LinuxChromeBloat'], + hour=2) + c['schedulers'].append(nightly_scheduler) + + # The Bloat calculator bot is setup without the helper classes since they + # don't have support for a Nightly scheduler. + chrome_bloat_factory = linux().ChromiumWebRTCBloatFactory( + target='Release', + factory_properties={'safesync_url': CHROME_LKGR, + 'gclient_env': {'GYP_DEFINES': 'profiling=1'}}) + chrome_bloat_builder = { + 'name': 'LinuxChromeBloat', + 'factory': chrome_bloat_factory, + 'category': 'linux', + } + c['builders'].append(chrome_bloat_builder) diff --git a/tools/continuous_build/build_internal/masters/master.webrtc/master_source_cfg.py b/tools/continuous_build/build_internal/masters/master.webrtc/master_source_cfg.py new file mode 100644 index 000000000..8af6c9e9e --- /dev/null +++ b/tools/continuous_build/build_internal/masters/master.webrtc/master_source_cfg.py @@ -0,0 +1,33 @@ +#!/usr/bin/env python +# Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. +# +# Use of this source code is governed by a BSD-style license +# that can be found in the LICENSE file in the root of the source +# tree. An additional intellectual property rights grant can be found +# in the file PATENTS. All contributing project authors may +# be found in the AUTHORS file in the root of the source tree. + +__author__ = 'kjellander@webrtc.org (Henrik Kjellander)' + +"""Source control poller for the WebRTC code.""" + +from buildbot.changes import svnpoller +from master import build_utils + + +def WebRTCFileSplitter(path): + """Splits the SVN path into branch and filename sections.""" + # We're currently only using trunk branch but we may soon start building + # multiple branches. + projects = ['trunk'] + return build_utils.SplitPath(projects, path) + + +def ConfigureChangeSource(config, c): + webrtc_revlinktmpl = 'http://code.google.com/p/webrtc/source/browse?r=%s' + webrtc_poller = svnpoller.SVNPoller(svnurl=config.Master.webrtc_root_url, + split_file=WebRTCFileSplitter, + pollinterval=30, + histmax=10, + revlinktmpl=webrtc_revlinktmpl) + c['change_source'] = webrtc_poller diff --git a/tools/continuous_build/build_internal/masters/master.webrtc/slaves.cfg b/tools/continuous_build/build_internal/masters/master.webrtc/slaves.cfg index df70dad2a..95c10f73b 100644 --- a/tools/continuous_build/build_internal/masters/master.webrtc/slaves.cfg +++ b/tools/continuous_build/build_internal/masters/master.webrtc/slaves.cfg @@ -102,7 +102,7 @@ def linux(): 'os': 'linux', 'version': 'lucid', 'bits': '64', - 'builder': 'Chrome', + 'builder': ['LinuxChrome', 'LinuxChromeBloat'], 'hostname': 'webrtc-chrome', }, ] @@ -125,6 +125,14 @@ def mac(): 'builder': 'MacOS32Release', 'hostname': 'dhcp-172-28-249-167', }, + { + 'master': 'WebRTC', + 'os': 'mac', + 'version': '10.7', + 'bits': '64', + 'builder': 'MacChrome', + 'hostname': 'dhcp-172-28-249-146', + }, ] def windows(): @@ -145,6 +153,14 @@ def windows(): 'builder': 'Win32Release', 'hostname': 'webrtc-win2k8-2', }, + { + 'master': 'WebRTC', + 'os': 'win', + 'version': 'win7', + 'bits': '64', + 'builder': 'WinChrome', + 'hostname': 'webrtc-chrome-w', + }, ] slaves = linux() + mac() + windows() diff --git a/tools/continuous_build/build_internal/scripts/webrtc_buildbot/utils.py b/tools/continuous_build/build_internal/scripts/webrtc_buildbot/utils.py index 30e95d872..35868cce4 100755 --- a/tools/continuous_build/build_internal/scripts/webrtc_buildbot/utils.py +++ b/tools/continuous_build/build_internal/scripts/webrtc_buildbot/utils.py @@ -35,8 +35,6 @@ WEBRTC_BUILD_DIR = 'build' MEMCHECK_CMD = ['tools/valgrind-webrtc/webrtc_tests.sh', '-t'] DEFAULT_COVERAGE_DIR = '/var/www/coverage' -DEFAULT_BLOAT_DIR = '/var/www/bloat' -DEFAULT_BLOAT_URL = 'http://webrtc-chrome.lul/bloat/webrtc_bloat.html' DEFAULT_MASTER_WORK_DIR = '.' GCLIENT_RETRIES = 3 @@ -467,17 +465,6 @@ class GenerateCodeCoverage(ShellCommand): ShellCommand.start(self) -class ShellCommandWithUrl(ShellCommand): - """A regular shell command which posts a link when it's done.""" - def __init__(self, url, **kwargs): - ShellCommand.__init__(self, **kwargs) - self.addFactoryArguments(url=url) - self.url = url - - def createSummary(self, log): - self.addURL('click here', self.url) - - class WebRTCAndroidFactory(WebRTCFactory): """Sets up the Android build.""" @@ -525,89 +512,6 @@ class WebRTCAndroidNDKFactory(WebRTCFactory): self.AddCommonStep(cmd=full_cmd, descriptor=descriptor) -class WebRTCChromeFactory(WebRTCFactory): - """Sets up the Chrome Browser+WebRTC build.""" - - def __init__(self, build_status_oracle, - gclient_solution_name, - svn_url, - custom_deps_list=None, - safesync_url=None): - WebRTCFactory.__init__(self, build_status_oracle=build_status_oracle, - gclient_solution_name=gclient_solution_name, - svn_url=svn_url, - custom_deps_list=custom_deps_list, - safesync_url=safesync_url) - self.build_enabled = False - - def EnableBuild(self, release=False, enable_profiling=False): - self.AddCommonStep(['rm', '-rf', 'src'], workdir=WEBRTC_BUILD_DIR, - descriptor='Cleanup') - self.AddGclientSyncStep(always_use_latest=True) - if enable_profiling: - self.AddCommonStep(['./build/gyp_chromium', '-Dprofiling=1'], - descriptor="gyp_chromium", - warn_on_failure=True, workdir='build/src') - - chrome_targets = ['chrome', 'pyautolib'] - if release: - self.AddCommonMakeStep(chrome_targets, 'BUILDTYPE=Release') - else: - self.AddCommonMakeStep(chrome_targets) - - self.build_enabled = True - self.release = release - self.profiling = enable_profiling - - def EnableBloatCalculation(self): - """Runs a bloat calculation, which will yield a size breakdown for Chrome. - - If running in Release mode, you should also run with profiling to get the - symbols right. Running this on Debug mode will work but it will probably - take hours. - """ - assert self.build_enabled is True - assert (self.release and self.profiling) or not self.release - - bloat_path = PosixPathJoin(WEBRTC_BUILD_DIR, '..', '..', '..', '..', '..', - '..', 'build_internal', 'symsrc', - 'calculate_bloat.py') - output_filename = PosixPathJoin(DEFAULT_BLOAT_DIR, 'bloat_latest.json') - build_directory = 'Release' if self.release else 'Debug' - chrome_binary = PosixPathJoin('out', build_directory, 'chrome') - cmd = [bloat_path, '--binary', chrome_binary, '--source-path', '.', - '--output-file', output_filename] - self.addStep(ShellCommandWithUrl(command=cmd, - url=DEFAULT_BLOAT_URL, - description='calculate_bloat.py', - warnOnFailure=True, - workdir='build/src', - timeout=7200)) - - 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' - ' --enable-peer-connection"') - cmd = MakeCommandToRunTestInXvfb(test + pyauto_flags) - self.AddCommonStep(cmd=cmd, descriptor=descriptor, workdir='build/src') - class WebRTCLinuxFactory(WebRTCFactory): """Sets up the Linux build. diff --git a/tools/continuous_build/build_internal/scripts/webrtc_buildbot/webrtc_chromium_factory.py b/tools/continuous_build/build_internal/scripts/webrtc_buildbot/webrtc_chromium_factory.py new file mode 100644 index 000000000..052c248fa --- /dev/null +++ b/tools/continuous_build/build_internal/scripts/webrtc_buildbot/webrtc_chromium_factory.py @@ -0,0 +1,55 @@ +#!/usr/bin/env python +# Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. +# +# Use of this source code is governed by a BSD-style license +# that can be found in the LICENSE file in the root of the source +# tree. An additional intellectual property rights grant can be found +# in the file PATENTS. All contributing project authors may +# be found in the AUTHORS file in the root of the source tree. + +__author__ = 'kjellander@webrtc.org (Henrik Kjellander)' + +"""Utility class to build Chromium with the latest WebRTC. + +Based on chromium_factory.py and adds WebRTC-specific custom_deps.""" + +from master.factory import chromium_factory +from webrtc_buildbot import webrtc_commands + + +class ChromiumWebRTCFactory(chromium_factory.ChromiumFactory): + + # gclient additional custom deps + CUSTOM_DEPS_WEBRTC_LATEST = ('src/third_party/webrtc', + 'http://webrtc.googlecode.com/svn/stable/src') + + def ChromiumWebRTCLatestFactory(self, target='Release', clobber=False, + tests=None, mode=None, + slave_type='BuilderTester', options=None, + compile_timeout=1200, build_url=None, + project=None, factory_properties=None): + self._solutions[0].custom_deps_list = [self.CUSTOM_DEPS_WEBRTC_LATEST] + factory = self.ChromiumFactory(target, clobber, tests, mode, slave_type, + options, compile_timeout, build_url, project, + factory_properties) + webrtc_cmd_obj = webrtc_commands.WebRTCCommands(factory, target, + self._build_dir, + self._target_platform) + webrtc_cmd_obj.AddCompilePeerConnectionServerStep() + webrtc_cmd_obj.AddPyAutoTests(factory_properties) + return factory + + def ChromiumWebRTCBloatFactory(self, target='Release', clobber=False, + tests=None, mode=None, + slave_type='BuilderTester', options=None, + compile_timeout=1200, build_url=None, + project=None, factory_properties=None): + self._solutions[0].custom_deps_list = [self.CUSTOM_DEPS_WEBRTC_LATEST] + factory = self.ChromiumFactory(target, clobber, tests, mode, slave_type, + options, compile_timeout, build_url, project, + factory_properties) + webrtc_cmd_obj = webrtc_commands.WebRTCCommands(factory, target, + self._build_dir, + self._target_platform) + webrtc_cmd_obj.AddBloatCalculationStep(factory_properties) + return factory diff --git a/tools/continuous_build/build_internal/scripts/webrtc_buildbot/webrtc_commands.py b/tools/continuous_build/build_internal/scripts/webrtc_buildbot/webrtc_commands.py new file mode 100644 index 000000000..8967f8c0a --- /dev/null +++ b/tools/continuous_build/build_internal/scripts/webrtc_buildbot/webrtc_commands.py @@ -0,0 +1,108 @@ +#!/usr/bin/env python +# Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. +# +# Use of this source code is governed by a BSD-style license +# that can be found in the LICENSE file in the root of the source +# tree. An additional intellectual property rights grant can be found +# in the file PATENTS. All contributing project authors may +# be found in the AUTHORS file in the root of the source tree. + +__author__ = 'kjellander@webrtc.org (Henrik Kjellander)' + +"""Set of utilities to add commands to a buildbot factory. + +This is based on chromium_commands.py and adds WebRTC-specific commands.""" + +from buildbot.steps.shell import ShellCommand + +from master.factory import chromium_commands +from webrtc_buildbot import utils + +DEFAULT_BLOAT_DIR = '/var/www/bloat' +DEFAULT_BLOAT_URL = 'http://webrtc-chrome.lul/bloat/webrtc_bloat.html' + + +class PlatformNotSupportedException(Exception): pass +class MissingGypDefineException(Exception): pass + + +class WebRTCCommands(chromium_commands.ChromiumCommands): + """Encapsulates methods to add WebRTC commands to a buildbot factory.""" + + def __init__(self, factory=None, target=None, build_dir=None, + target_platform=None, target_arch=None): + chromium_commands.ChromiumCommands.__init__(self, factory, target, + build_dir, target_platform) + + self._arch = target_arch + self._factory = factory + + def AddPyAutoTests(self, factory_properties=None, timeout=1200): + """Adds WebRTC PyAuto test steps.""" + # The WEBRTC group lists the PyAuto tests we have written for WebRTC. + # It's located at: src/chrome/test/functional/PYAUTO_TESTS + self.AddPyAutoFunctionalTest('WebRTC functional PyAuto test', + suite='WEBRTC', timeout=timeout, perf=False, + factory_properties=factory_properties) + + def AddCompilePeerConnectionServerStep(self): + # Add platform dependent peerconnection_server compilation: + solution = None + options = None + if self._target_platform.startswith('linux'): + options=['peerconnection_server'] + elif self._target_platform.startswith('win'): + solution=r'..\third_party\libjingle\libjingle.sln;peerconnection_server' + elif self._target_platform is 'mac': + options=['--', '-project', '../third_party/libjingle/libjingle.xcodeproj', + '-target', 'peerconnection_server'], + else: + raise PlatformNotSupportedException( + 'Platform "%s" is not currently supported.' % self._target_platform) + self.AddCompileStep(solution=solution, + options=options, + description='compiling peerconnection_server', + descriptionDone='compile peerconnection_server') + + def AddBloatCalculationStep(self, factory_properties): + """Runs a bloat calculation, which will yield a size breakdown for Chrome. + + If running in Release mode, you should also run with profiling to get the + symbols right. Running this on Debug mode will work but it will probably + take hours. + + This step command is only supported on Linux platforms. + """ + if self._target is 'Release': + factory = factory_properties + if not (factory.has_key('gclient_env') and + factory['gclient_env'].has_key('GYP_DEFINES') and + factory['gclient_env']['GYP_DEFINES'].find('profiling=1') != -1): + raise MissingGypDefineException( + 'You must add a dictionary to the gclient_env factory property' + 'containing a key GYP_DEFINES and a value containing profiling=1.') + + bloat_path = self.PathJoin(utils.WEBRTC_BUILD_DIR, '..', '..', '..', '..', + '..', '..', 'build_internal', 'symsrc', + 'calculate_bloat.py') + output_filename = self.PathJoin(DEFAULT_BLOAT_DIR, 'bloat_latest.json') + chrome_binary = self.PathJoin('out', self._target, 'chrome') + cmd = [bloat_path, '--binary', chrome_binary, '--source-path', '.', + '--output-file', output_filename] + self._factory.addStep(ShellCommandWithUrl(command=cmd, + url=DEFAULT_BLOAT_URL, + description='calculate bloat', + warnOnFailure=True, + workdir='build/src', + timeout=7200)) + + +class ShellCommandWithUrl(ShellCommand): + """A regular shell command which posts a link when it's done.""" + def __init__(self, url, **kwargs): + ShellCommand.__init__(self, **kwargs) + self.addFactoryArguments(url=url) + self.url = url + + def createSummary(self, log): + self.addURL('click here', self.url) diff --git a/tools/continuous_build/build_internal/site_config/config_private.py b/tools/continuous_build/build_internal/site_config/config_private.py index 7980fbe90..d85e7aebf 100644 --- a/tools/continuous_build/build_internal/site_config/config_private.py +++ b/tools/continuous_build/build_internal/site_config/config_private.py @@ -14,13 +14,16 @@ import socket class Master(object): # Repository URLs used by the SVNPoller and 'gclient config'. - server_url = 'http://webrtc.googlecode.com' - git_server_url = 'http://webrtc.googlecode.com/git' + webrtc_root_url = 'http://webrtc.googlecode.com/svn' + + # Leave Chromium's server URL intact, since we also build Chrome. + server_url = 'http://src.chromium.org' + git_server_url = 'http://src.chromium.org/git' repo_root = '/svn' # External repos. googlecode_url = 'http://%s.googlecode.com/svn' - sourceforge_url = 'https://%(repo)s.svn.sourceforge.net/svnroot/%(repo)s' + sourceforge_url = 'http://%(repo)s.svn.sourceforge.net/svnroot/%(repo)s' # Directly fetches from anonymous webkit svn server. webkit_root_url = 'http://svn.webkit.org/repository/webkit'