| OLD | NEW |
| 1 # Copyright 2013 The Chromium Authors. All rights reserved. | 1 # Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 DEPS = [ | 5 DEPS = [ |
| 6 'chromium', | |
| 7 'chromium_android', | 6 'chromium_android', |
| 8 'properties', | 7 'properties', |
| 9 'json', | |
| 10 'path', | |
| 11 'python', | |
| 12 ] | 8 ] |
| 13 | 9 |
| 14 BUILDERS = { | 10 BUILDERS = { |
| 15 'Android ARM64 Builder (dbg)': { | 11 'Android ARM64 Builder (dbg)': { |
| 16 'recipe_config': 'arm64_builder', | 12 'recipe_config': 'arm64_builder', |
| 17 'kwargs': { | |
| 18 'BUILD_CONFIG': 'Debug', | |
| 19 'REPO_NAME': 'src', | |
| 20 'INTERNAL': False, | |
| 21 'REPO_URL': 'svn://svn-mirror.golo.chromium.org/chrome/trunk/src', | |
| 22 }, | |
| 23 'custom': { | |
| 24 'deps_file': 'DEPS' | |
| 25 } | |
| 26 }, | 13 }, |
| 27 'Android x64 Builder (dbg)': { | 14 'Android x64 Builder (dbg)': { |
| 28 'recipe_config': 'x64_builder', | 15 'recipe_config': 'x64_builder', |
| 29 'kwargs': { | |
| 30 'BUILD_CONFIG': 'Debug', | |
| 31 'REPO_NAME': 'src', | |
| 32 'INTERNAL': False, | |
| 33 'REPO_URL': 'svn://svn-mirror.golo.chromium.org/chrome/trunk/src' | |
| 34 }, | |
| 35 'custom': { | |
| 36 'deps_file': 'DEPS' | |
| 37 } | |
| 38 }, | 16 }, |
| 39 'Android MIPS Builder (dbg)': { | 17 'Android MIPS Builder (dbg)': { |
| 40 'recipe_config': 'mipsel_builder', | 18 'recipe_config': 'mipsel_builder', |
| 41 'kwargs': { | |
| 42 'BUILD_CONFIG': 'Debug', | |
| 43 'REPO_NAME': 'src', | |
| 44 'INTERNAL': False, | |
| 45 'REPO_URL': 'svn://svn-mirror.golo.chromium.org/chrome/trunk/src' | |
| 46 }, | |
| 47 'custom': { | |
| 48 'deps_file': 'DEPS' | |
| 49 } | |
| 50 } | 19 } |
| 51 } | 20 } |
| 52 | 21 |
| 53 def GenSteps(api): | 22 def GenSteps(api): |
| 54 buildername = api.properties.get('buildername') | 23 buildername = api.properties['buildername'] |
| 55 bot_config = BUILDERS.get(buildername) | 24 bot_config = BUILDERS[buildername] |
| 56 droid = api.chromium_android | 25 droid = api.chromium_android |
| 57 | 26 |
| 58 bot_id = '' | 27 default_kwargs = { |
| 59 internal = False | 28 'REPO_URL': 'svn://svn-mirror.golo.chromium.org/chrome/trunk/src', |
| 60 if bot_config: | 29 'INTERNAL': False, |
| 61 default_kwargs = { | 30 'REPO_NAME': 'src', |
| 62 'REPO_URL': 'https://chromium.googlesource.com/chromium/src.git', | 31 'BUILD_CONFIG': 'Debug' |
| 63 'INTERNAL': False, | 32 } |
| 64 'REPO_NAME': 'src', | 33 droid.configure_from_properties(bot_config['recipe_config'], **default_kwargs) |
| 65 'BUILD_CONFIG': 'Debug' | 34 droid.c.set_val({'deps_file': 'DEPS'}) |
| 66 } | |
| 67 kwargs = bot_config.get('kwargs', {}) | |
| 68 droid.configure_from_properties(bot_config['recipe_config'], | |
| 69 **dict(default_kwargs.items() + kwargs.items())) | |
| 70 droid.c.set_val(bot_config.get('custom', {})) | |
| 71 else: | |
| 72 # Bots that don't belong to BUILDERS. We want to move away from this. | |
| 73 internal = api.properties.get('internal') | |
| 74 bot_id = api.properties['android_bot_id'] | |
| 75 droid.configure_from_properties(bot_id) | |
| 76 | 35 |
| 77 yield droid.init_and_sync() | 36 yield droid.init_and_sync() |
| 78 yield droid.clean_local_files() | 37 yield droid.clean_local_files() |
| 79 if internal and droid.c.run_tree_truth: | 38 yield droid.runhooks() |
| 80 yield droid.run_tree_truth() | |
| 81 | |
| 82 # TODO(iannucci): Remove when dartium syncs chromium to >= crrev.com/252649 | |
| 83 extra_env = {} | |
| 84 if bot_id == 'dartium_builder': | |
| 85 extra_env = {'GYP_CROSSCOMPILE': "1"} | |
| 86 yield droid.runhooks(extra_env) | |
| 87 | |
| 88 if bot_id in ['try_builder', 'x86_try_builder']: | |
| 89 yield droid.apply_svn_patch() | |
| 90 yield droid.compile() | 39 yield droid.compile() |
| 91 | |
| 92 if bot_id in ['clang_builder', 'try_builder', 'x86_try_builder']: | |
| 93 yield droid.findbugs() | |
| 94 yield droid.lint() | |
| 95 if bot_id == 'clang_builder': | |
| 96 yield droid.checkdeps() | |
| 97 | |
| 98 if bot_id == 'clang_release_builder': | |
| 99 yield droid.upload_clusterfuzz() | |
| 100 elif internal and droid.c.get_app_manifest_vars: | |
| 101 yield droid.upload_build_for_tester() | |
| 102 | |
| 103 yield droid.cleanup_build() | 40 yield droid.cleanup_build() |
| 104 | 41 |
| 105 if api.properties.get('android_bot_id') == "dartium_builder": | |
| 106 yield api.python('dartium_test', | |
| 107 api.path['slave_build'].join('src', 'dart', 'tools', | |
| 108 'bots', 'dartium_android.py'), | |
| 109 args = ['--build-products-dir', | |
| 110 api.chromium.c.build_dir.join(api.chromium.c.build_config_fs)] | |
| 111 ) | |
| 112 | 42 |
| 113 def _sanitize_nonalpha(text): | 43 def _sanitize_nonalpha(text): |
| 114 return ''.join(c if c.isalnum() else '_' for c in text) | 44 return ''.join(c if c.isalnum() else '_' for c in text) |
| 115 | 45 |
| 116 def GenTests(api): | 46 def GenTests(api): |
| 117 # non BUILDER bots | |
| 118 bot_ids = ['main_builder', 'component_builder', 'clang_builder', | |
| 119 'clang_release_builder', 'x86_builder', 'arm_builder', | |
| 120 'try_builder', 'x86_try_builder', 'dartium_builder', | |
| 121 'mipsel_builder', 'arm_builder_rel'] | |
| 122 | |
| 123 def old_properties(bot_id): | |
| 124 return api.properties.generic( | |
| 125 repo_name='src/repo', | |
| 126 repo_url='svn://svn.chromium.org/chrome/trunk/src', | |
| 127 revision='4f4b02f6b7fa20a3a25682c457bbc8ad589c8a00', | |
| 128 android_bot_id=bot_id, | |
| 129 buildername=bot_id, # TODO(luqui): fix buildername to match master | |
| 130 buildnumber=1337, | |
| 131 internal=True, | |
| 132 deps_file='DEPS', | |
| 133 managed=True, | |
| 134 ) | |
| 135 | |
| 136 for bot_id in bot_ids: | |
| 137 props = old_properties(bot_id) | |
| 138 if 'try_builder' in bot_id: | |
| 139 props += api.properties(revision='refs/remotes/origin/master') | |
| 140 props += api.properties(patch_url='try_job_svn_patch') | |
| 141 | |
| 142 # dartium_builder does not use any step_data | |
| 143 if bot_id == 'dartium_builder': | |
| 144 add_step_data = lambda p: p | |
| 145 else: | |
| 146 add_step_data = lambda p: p + api.chromium_android.default_step_data(api) | |
| 147 | |
| 148 yield add_step_data(api.test(bot_id) + props) | |
| 149 | |
| 150 yield (api.test('clang_builder_findbugs_failure') + | |
| 151 old_properties('clang_builder') + | |
| 152 api.step_data('findbugs internal', retcode=1) + | |
| 153 api.chromium_android.default_step_data(api)) | |
| 154 | |
| 155 # tests bots in BUILDERS | 47 # tests bots in BUILDERS |
| 156 for buildername in BUILDERS: | 48 for buildername in BUILDERS: |
| 157 test = ( | 49 yield ( |
| 158 api.test('full_%s' % _sanitize_nonalpha(buildername)) + | 50 api.test('full_%s' % _sanitize_nonalpha(buildername)) + |
| 159 api.properties.generic(buildername=buildername, | 51 api.properties.generic(buildername=buildername, |
| 160 repository='svn://svn.chromium.org/chrome/trunk/src', | 52 repository='svn://svn.chromium.org/chrome/trunk/src', |
| 161 buildnumber=257, | 53 buildnumber=257, |
| 162 mastername='chromium.fyi', | 54 mastername='chromium.fyi', |
| 163 revision='267739')) | 55 revision='267739')) |
| 164 yield test | |
| OLD | NEW |