| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # | 2 # |
| 3 # Copyright (c) 2013 The Chromium Authors. All rights reserved. | 3 # Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| 4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
| 5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
| 6 | 6 |
| 7 import collections | 7 import collections |
| 8 import copy | 8 import copy |
| 9 import json | 9 import json |
| 10 import os | 10 import os |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 diff.append('+ %s=%s' % (key, pipes.quote(d2[key]))) | 38 diff.append('+ %s=%s' % (key, pipes.quote(d2[key]))) |
| 39 return '\n'.join(diff) | 39 return '\n'.join(diff) |
| 40 | 40 |
| 41 | 41 |
| 42 def GetEnvironment(host_obj, testing): | 42 def GetEnvironment(host_obj, testing): |
| 43 init_env = dict(os.environ) | 43 init_env = dict(os.environ) |
| 44 init_env['GYP_GENERATORS'] = 'ninja' | 44 init_env['GYP_GENERATORS'] = 'ninja' |
| 45 init_env['GOMA_DIR'] = bb_utils.GOMA_DIR | 45 init_env['GOMA_DIR'] = bb_utils.GOMA_DIR |
| 46 envsetup_cmd = '. build/android/envsetup.sh' | 46 envsetup_cmd = '. build/android/envsetup.sh' |
| 47 if host_obj.target_arch: | 47 if host_obj.target_arch: |
| 48 envsetup_cmd += ' --target_arch=%s' % host_obj.target_arch | 48 envsetup_cmd += ' --target-arch=%s' % host_obj.target_arch |
| 49 if testing: | 49 if testing: |
| 50 # Skip envsetup to avoid presubmit dependence on android deps. | 50 # Skip envsetup to avoid presubmit dependence on android deps. |
| 51 print 'Testing mode - skipping "%s"' % envsetup_cmd | 51 print 'Testing mode - skipping "%s"' % envsetup_cmd |
| 52 envsetup_cmd = ':' | 52 envsetup_cmd = ':' |
| 53 else: | 53 else: |
| 54 print 'Running %s' % envsetup_cmd | 54 print 'Running %s' % envsetup_cmd |
| 55 proc = subprocess.Popen(['bash', '-exc', | 55 proc = subprocess.Popen(['bash', '-exc', |
| 56 envsetup_cmd + ' >&2; python build/android/buildbot/env_to_json.py'], | 56 envsetup_cmd + ' >&2; python build/android/buildbot/env_to_json.py'], |
| 57 stdout=subprocess.PIPE, stderr=subprocess.PIPE, | 57 stdout=subprocess.PIPE, stderr=subprocess.PIPE, |
| 58 cwd=bb_utils.CHROME_SRC, env=init_env) | 58 cwd=bb_utils.CHROME_SRC, env=init_env) |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 return commands | 105 return commands |
| 106 | 106 |
| 107 | 107 |
| 108 def GetBotStepMap(): | 108 def GetBotStepMap(): |
| 109 compile_step = ['compile'] | 109 compile_step = ['compile'] |
| 110 std_host_tests = ['check_webview_licenses', 'findbugs'] | 110 std_host_tests = ['check_webview_licenses', 'findbugs'] |
| 111 std_build_steps = ['compile', 'zip_build'] | 111 std_build_steps = ['compile', 'zip_build'] |
| 112 std_test_steps = ['extract_build'] | 112 std_test_steps = ['extract_build'] |
| 113 std_tests = ['ui', 'unit'] | 113 std_tests = ['ui', 'unit'] |
| 114 flakiness_server = '--upload-to-flakiness-server' | 114 flakiness_server = '--upload-to-flakiness-server' |
| 115 experimental = ['--experimental'] |
| 115 | 116 |
| 116 B = BotConfig | 117 B = BotConfig |
| 117 H = (lambda steps, extra_args=None, extra_gyp=None, target_arch=None : | 118 H = (lambda steps, extra_args=None, extra_gyp=None, target_arch=None : |
| 118 HostConfig('build/android/buildbot/bb_host_steps.py', steps, extra_args, | 119 HostConfig('build/android/buildbot/bb_host_steps.py', steps, extra_args, |
| 119 extra_gyp, target_arch)) | 120 extra_gyp, target_arch)) |
| 120 T = (lambda tests, extra_args=None : | 121 T = (lambda tests, extra_args=None : |
| 121 TestConfig('build/android/buildbot/bb_device_steps.py', tests, | 122 TestConfig('build/android/buildbot/bb_device_steps.py', tests, |
| 122 extra_args)) | 123 extra_args)) |
| 123 | 124 |
| 124 bot_configs = [ | 125 bot_configs = [ |
| 125 # Main builders | 126 # Main builders |
| 126 B('main-builder-dbg', H(std_build_steps + std_host_tests)), | 127 B('main-builder-dbg', H(std_build_steps + std_host_tests)), |
| 127 B('main-builder-rel', H(std_build_steps)), | 128 B('main-builder-rel', H(std_build_steps)), |
| 128 B('main-clang-builder', | 129 B('main-clang-builder', |
| 129 H(compile_step, extra_gyp='clang=1 component=shared_library')), | 130 H(compile_step, extra_gyp='clang=1 component=shared_library')), |
| 130 B('main-clobber', H(compile_step)), | 131 B('main-clobber', H(compile_step)), |
| 131 B('main-tests', H(std_test_steps), T(std_tests, [flakiness_server])), | 132 B('main-tests', H(std_test_steps), T(std_tests, [flakiness_server])), |
| 132 | 133 |
| 133 # Other waterfalls | 134 # Other waterfalls |
| 134 B('asan-builder-tests', H(compile_step, extra_gyp='asan=1'), | 135 B('asan-builder-tests', H(compile_step, extra_gyp='asan=1'), |
| 135 T(std_tests, ['--asan'])), | 136 T(std_tests, ['--asan'])), |
| 136 B('chromedriver-fyi-tests-dbg', H(std_test_steps), | 137 B('chromedriver-fyi-tests-dbg', H(std_test_steps), |
| 137 T(['chromedriver'], ['--install=ChromiumTestShell'])), | 138 T(['chromedriver'], ['--install=ChromiumTestShell'])), |
| 139 B('fyi-x86-builder-dbg', |
| 140 H(compile_step + std_host_tests, experimental, target_arch='x86')), |
| 138 B('fyi-builder-dbg', | 141 B('fyi-builder-dbg', |
| 139 H(std_build_steps + std_host_tests, ['--experimental'])), | 142 H(std_build_steps + std_host_tests, experimental)), |
| 140 B('fyi-builder-rel', H(std_build_steps, ['--experimental'])), | 143 B('x86-builder-dbg', |
| 141 B('fyi-tests-dbg-ics-gn', H(compile_step, [ '--experimental']), | 144 H(compile_step + std_host_tests, target_arch='x86')), |
| 142 T(std_tests, ['--experimental', flakiness_server])), | 145 B('fyi-builder-rel', H(std_build_steps, experimental)), |
| 143 B('fyi-tests', H(std_test_steps), | 146 B('fyi-tests', H(std_test_steps), |
| 144 T(std_tests, ['--experimental', flakiness_server])), | 147 T(std_tests, ['--experimental', flakiness_server])), |
| 145 B('fyi-component-builder-tests-dbg', | 148 B('fyi-component-builder-tests-dbg', |
| 146 H(compile_step, extra_gyp='component=shared_library'), | 149 H(compile_step, extra_gyp='component=shared_library'), |
| 147 T(std_tests, ['--experimental', flakiness_server])), | 150 T(std_tests, ['--experimental', flakiness_server])), |
| 148 B('perf-bisect-builder-tests-dbg', H(['bisect_perf_regression'])), | 151 B('perf-bisect-builder-tests-dbg', H(['bisect_perf_regression'])), |
| 149 B('perf-tests-rel', H(std_test_steps), | 152 B('perf-tests-rel', H(std_test_steps), |
| 150 T([], ['--install=ChromiumTestShell'])), | 153 T([], ['--install=ChromiumTestShell'])), |
| 151 B('webkit-latest-webkit-tests', H(std_test_steps), | 154 B('webkit-latest-webkit-tests', H(std_test_steps), |
| 152 T(['webkit_layout', 'webkit'])), | 155 T(['webkit_layout', 'webkit'])), |
| 153 B('webkit-latest-contentshell', H(compile_step), T(['webkit_layout'])), | 156 B('webkit-latest-contentshell', H(compile_step), T(['webkit_layout'])), |
| 154 B('builder-unit-tests', H(compile_step), T(['unit'])), | 157 B('builder-unit-tests', H(compile_step), T(['unit'])), |
| 155 | 158 |
| 156 # Generic builder config (for substring match). | 159 # Generic builder config (for substring match). |
| 157 B('builder', H(std_build_steps)), | 160 B('builder', H(std_build_steps)), |
| 158 ] | 161 ] |
| 159 | 162 |
| 160 bot_map = dict((config.bot_id, config) for config in bot_configs) | 163 bot_map = dict((config.bot_id, config) for config in bot_configs) |
| 161 | 164 |
| 162 # These bots have identical configuration to ones defined earlier. | 165 # These bots have identical configuration to ones defined earlier. |
| 163 copy_map = [ | 166 copy_map = [ |
| 164 ('lkgr-clobber', 'main-clobber'), | 167 ('lkgr-clobber', 'main-clobber'), |
| 165 ('try-builder-dbg', 'main-builder-dbg'), | 168 ('try-builder-dbg', 'main-builder-dbg'), |
| 166 ('try-builder-rel', 'main-builder-rel'), | 169 ('try-builder-rel', 'main-builder-rel'), |
| 167 ('try-clang-builder', 'main-clang-builder'), | 170 ('try-clang-builder', 'main-clang-builder'), |
| 168 ('try-fyi-builder-dbg', 'fyi-builder-dbg'), | 171 ('try-fyi-builder-dbg', 'fyi-builder-dbg'), |
| 172 ('try-x86-builder-dbg', 'x86-builder-dbg'), |
| 169 ('try-tests', 'main-tests'), | 173 ('try-tests', 'main-tests'), |
| 170 ('try-fyi-tests', 'fyi-tests'), | 174 ('try-fyi-tests', 'fyi-tests'), |
| 171 ('webkit-latest-tests', 'main-tests'), | 175 ('webkit-latest-tests', 'main-tests'), |
| 172 ] | 176 ] |
| 173 for to_id, from_id in copy_map: | 177 for to_id, from_id in copy_map: |
| 174 assert to_id not in bot_map | 178 assert to_id not in bot_map |
| 175 # pylint: disable=W0212 | 179 # pylint: disable=W0212 |
| 176 bot_map[to_id] = copy.deepcopy(bot_map[from_id])._replace(bot_id=to_id) | 180 bot_map[to_id] = copy.deepcopy(bot_map[from_id])._replace(bot_id=to_id) |
| 177 | 181 |
| 178 # Trybots do not upload to flakiness dashboard. They should be otherwise | 182 # Trybots do not upload to flakiness dashboard. They should be otherwise |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 240 sys.stdout.flush() | 244 sys.stdout.flush() |
| 241 if options.testing: | 245 if options.testing: |
| 242 env['BUILDBOT_TESTING'] = '1' | 246 env['BUILDBOT_TESTING'] = '1' |
| 243 return_code = subprocess.call(command, cwd=bb_utils.CHROME_SRC, env=env) | 247 return_code = subprocess.call(command, cwd=bb_utils.CHROME_SRC, env=env) |
| 244 if return_code != 0: | 248 if return_code != 0: |
| 245 return return_code | 249 return return_code |
| 246 | 250 |
| 247 | 251 |
| 248 if __name__ == '__main__': | 252 if __name__ == '__main__': |
| 249 sys.exit(main(sys.argv)) | 253 sys.exit(main(sys.argv)) |
| OLD | NEW |