Index: scripts/slave/recipes/webrtc/standalone.py |
diff --git a/scripts/slave/recipes/webrtc/standalone.py b/scripts/slave/recipes/webrtc/standalone.py |
index d964024d6d15069714132445092e2e4910be75ec..b62ae8cee9860c9897d828d85d7db91f8af9543a 100644 |
--- a/scripts/slave/recipes/webrtc/standalone.py |
+++ b/scripts/slave/recipes/webrtc/standalone.py |
@@ -5,7 +5,9 @@ |
# Recipe for building and running tests for WebRTC stand-alone. |
DEPS = [ |
+ 'archive', |
'chromium', |
+ 'chromium_android', |
'gclient', |
'path', |
'platform', |
@@ -22,9 +24,12 @@ def GenSteps(api): |
master_dict = api.webrtc.BUILDERS.get(mastername, {}) |
master_settings = master_dict.get('settings', {}) |
bot_config = master_dict.get('builders', {}).get(buildername) |
- bot_type = bot_config.get('bot_type', 'builder_tester') |
assert bot_config, ('Unrecognized builder name "%r" for master "%r".' % |
(buildername, mastername)) |
+ bot_type = bot_config.get('bot_type', 'builder_tester') |
+ does_build = bot_type in ('builder', 'builder_tester') |
+ does_test = bot_type in ('builder_tester', 'tester') |
+ |
recipe_config_name = bot_config['recipe_config'] |
recipe_config = api.webrtc.RECIPE_CONFIGS.get(recipe_config_name) |
assert recipe_config, ('Cannot find recipe_config "%s" for builder "%r".' % |
@@ -53,48 +58,75 @@ def GenSteps(api): |
api.chromium.runhooks() |
- if api.chromium.c.project_generator.tool == 'gn': |
- api.chromium.run_gn() |
- api.chromium.compile(targets=['all']) |
- else: |
- api.chromium.compile() |
+ if does_build: |
+ if api.chromium.c.project_generator.tool == 'gn': |
+ api.chromium.run_gn() |
+ api.chromium.compile(targets=['all']) |
+ else: |
+ api.chromium.compile() |
+ |
+ if api.chromium.c.gyp_env.GYP_DEFINES.get('syzyasan', 0) == 1: |
+ api.chromium.apply_syzyasan() |
- if api.chromium.c.gyp_env.GYP_DEFINES.get('syzyasan', 0) == 1: |
- api.chromium.apply_syzyasan() |
+ archive_revision = api.properties.get('parent_got_revision', got_revision) |
+ if bot_type == 'builder' and bot_config.get('build_gs_archive'): |
+ api.webrtc.package_build( |
+ api.webrtc.GS_ARCHIVES[bot_config['build_gs_archive']], |
+ archive_revision) |
- if bot_type in ('builder_tester', 'tester'): |
+ if bot_type == 'tester': |
+ api.webrtc.extract_build( |
+ api.webrtc.GS_ARCHIVES[bot_config['build_gs_archive']], |
+ archive_revision) |
+ |
+ if does_test: |
api.webrtc.cleanup() |
test_suite = recipe_config.get('test_suite') |
if test_suite: |
api.webrtc.runtests(test_suite, got_revision) |
+ |
def _sanitize_nonalpha(text): |
return ''.join(c if c.isalnum() else '_' for c in text.lower()) |
def GenTests(api): |
- def generate_builder(mastername, buildername, bot_config, revision, |
- legacy_trybot=False, suffix=None): |
+ builders = api.webrtc.BUILDERS |
+ |
+ def generate_builder(mastername, buildername, revision, |
+ parent_got_revision=None, legacy_trybot=False, |
+ suffix=None): |
suffix = suffix or '' |
+ bot_config = builders[mastername]['builders'][buildername] |
bot_type = bot_config.get('bot_type', 'builder_tester') |
+ |
if bot_type in ('builder', 'builder_tester'): |
assert bot_config.get('parent_buildername') is None, ( |
'Unexpected parent_buildername for builder %r on master %r.' % |
(buildername, mastername)) |
- webrtc_config_kwargs = bot_config.get('webrtc_config_kwargs', {}) |
+ webrtc_kwargs = bot_config.get('webrtc_config_kwargs', {}) |
test = ( |
api.test('%s_%s%s' % (_sanitize_nonalpha(mastername), |
_sanitize_nonalpha(buildername), suffix)) + |
api.properties(mastername=mastername, |
buildername=buildername, |
slavename='slavename', |
- BUILD_CONFIG=webrtc_config_kwargs['BUILD_CONFIG']) + |
+ BUILD_CONFIG=webrtc_kwargs['BUILD_CONFIG']) + |
api.platform(bot_config['testing']['platform'], |
- webrtc_config_kwargs.get('TARGET_BITS', 64)) |
+ webrtc_kwargs.get('TARGET_BITS', 64)) |
) |
+ |
+ if bot_config.get('parent_buildername'): |
+ test += api.properties( |
+ parent_buildername=bot_config['parent_buildername']) |
+ |
if revision: |
test += api.properties(revision=revision) |
+ if bot_type == 'tester': |
+ parent_rev = parent_got_revision or revision |
+ test += api.properties(parent_got_revision=parent_rev) |
+ |
if mastername.startswith('tryserver'): |
if legacy_trybot: |
test += api.properties(patch_url='try_job_svn_patch') |
@@ -104,23 +136,28 @@ def GenTests(api): |
return test |
for mastername in ('client.webrtc', 'client.webrtc.fyi', 'tryserver.webrtc'): |
- master_config = api.webrtc.BUILDERS[mastername] |
- for buildername, bot_config in master_config['builders'].iteritems(): |
- if bot_config['recipe_config'] == 'webrtc_android_apk': |
- continue |
- yield generate_builder(mastername, buildername, bot_config, |
- revision='12345') |
+ master_config = builders[mastername] |
+ for buildername in master_config['builders'].keys(): |
+ yield generate_builder(mastername, buildername, revision='12345') |
# Forced build (not specifying any revision). |
mastername = 'client.webrtc' |
buildername = 'Linux64 Debug' |
- bot_config = api.webrtc.BUILDERS[mastername]['builders'][buildername] |
- yield generate_builder(mastername, buildername, bot_config, revision=None, |
+ yield generate_builder(mastername, buildername, revision=None, |
suffix='_forced') |
+ buildername = 'Android Builder' |
+ yield generate_builder(mastername, buildername, revision=None, |
+ suffix='_forced') |
+ |
+ buildername = 'Android Tests (KK Nexus5)' |
+ yield generate_builder(mastername, buildername, revision=None, |
+ parent_got_revision='12345', suffix='_forced') |
+ yield generate_builder(mastername, buildername, revision=None, |
+ suffix='_forced_invalid') |
+ |
# Legacy trybot (SVN-based). |
mastername = 'tryserver.webrtc' |
buildername = 'linux' |
- bot_config = api.webrtc.BUILDERS[mastername]['builders'][buildername] |
- yield generate_builder(mastername, buildername, bot_config, revision='12345', |
+ yield generate_builder(mastername, buildername, revision='12345', |
legacy_trybot=True, suffix='_legacy_svn_patch') |