| 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', |
| 6 'chromium_android', | 7 'chromium_android', |
| 7 'properties', | 8 'properties', |
| 9 'json', |
| 10 'path', |
| 11 'python', |
| 8 ] | 12 ] |
| 9 | 13 |
| 10 BUILDERS = { | 14 BUILDERS = { |
| 11 'Android ARM64 Builder (dbg)': { | 15 'Android ARM64 Builder (dbg)': { |
| 12 'recipe_config': 'arm64_builder', | 16 '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 } |
| 13 }, | 26 }, |
| 14 'Android x64 Builder (dbg)': { | 27 'Android x64 Builder (dbg)': { |
| 15 'recipe_config': 'x64_builder', | 28 '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 } |
| 16 }, | 38 }, |
| 17 'Android MIPS Builder (dbg)': { | 39 'Android MIPS Builder (dbg)': { |
| 18 'recipe_config': 'mipsel_builder', | 40 '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 } |
| 19 } | 50 } |
| 20 } | 51 } |
| 21 | 52 |
| 22 def GenSteps(api): | 53 def GenSteps(api): |
| 23 buildername = api.properties['buildername'] | 54 buildername = api.properties.get('buildername') |
| 24 bot_config = BUILDERS[buildername] | 55 bot_config = BUILDERS.get(buildername) |
| 25 droid = api.chromium_android | 56 droid = api.chromium_android |
| 26 | 57 |
| 27 default_kwargs = { | 58 bot_id = '' |
| 28 'REPO_URL': 'svn://svn-mirror.golo.chromium.org/chrome/trunk/src', | 59 internal = False |
| 29 'INTERNAL': False, | 60 if bot_config: |
| 30 'REPO_NAME': 'src', | 61 default_kwargs = { |
| 31 'BUILD_CONFIG': 'Debug' | 62 'REPO_URL': 'https://chromium.googlesource.com/chromium/src.git', |
| 32 } | 63 'INTERNAL': False, |
| 33 droid.configure_from_properties(bot_config['recipe_config'], **default_kwargs) | 64 'REPO_NAME': 'src', |
| 34 droid.c.set_val({'deps_file': 'DEPS'}) | 65 'BUILD_CONFIG': 'Debug' |
| 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) |
| 35 | 76 |
| 36 yield droid.init_and_sync() | 77 yield droid.init_and_sync() |
| 37 yield droid.clean_local_files() | 78 yield droid.clean_local_files() |
| 38 yield droid.runhooks() | 79 if internal and droid.c.run_tree_truth: |
| 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() |
| 39 yield droid.compile() | 90 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 |
| 40 yield droid.cleanup_build() | 103 yield droid.cleanup_build() |
| 41 | 104 |
| 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 ) |
| 42 | 112 |
| 43 def _sanitize_nonalpha(text): | 113 def _sanitize_nonalpha(text): |
| 44 return ''.join(c if c.isalnum() else '_' for c in text) | 114 return ''.join(c if c.isalnum() else '_' for c in text) |
| 45 | 115 |
| 46 def GenTests(api): | 116 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 |
| 47 # tests bots in BUILDERS | 155 # tests bots in BUILDERS |
| 48 for buildername in BUILDERS: | 156 for buildername in BUILDERS: |
| 49 yield ( | 157 test = ( |
| 50 api.test('full_%s' % _sanitize_nonalpha(buildername)) + | 158 api.test('full_%s' % _sanitize_nonalpha(buildername)) + |
| 51 api.properties.generic(buildername=buildername, | 159 api.properties.generic(buildername=buildername, |
| 52 repository='svn://svn.chromium.org/chrome/trunk/src', | 160 repository='svn://svn.chromium.org/chrome/trunk/src', |
| 53 buildnumber=257, | 161 buildnumber=257, |
| 54 mastername='chromium.fyi', | 162 mastername='chromium.fyi', |
| 55 revision='267739')) | 163 revision='267739')) |
| 164 yield test |
| OLD | NEW |