| OLD | NEW |
| 1 # Copyright 2015 The Chromium Authors. All rights reserved. | 1 # Copyright 2015 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 import collections | 5 import collections |
| 6 | 6 |
| 7 from . import steps | 7 from . import steps |
| 8 | 8 |
| 9 | 9 |
| 10 _builders = collections.defaultdict(dict) | 10 _builders = collections.defaultdict(dict) |
| 11 | 11 |
| 12 | 12 |
| 13 SPEC = { | 13 SPEC = { |
| 14 'builders': {}, | 14 'builders': {}, |
| 15 'settings': { | 15 'settings': { |
| 16 'build_gs_bucket': 'chrome-perf', | 16 'build_gs_bucket': 'chrome-perf', |
| 17 }, | 17 }, |
| 18 } | 18 } |
| 19 | 19 |
| 20 | 20 |
| 21 def _BaseSpec(bot_type, chromium_apply_config, disable_tests, | 21 def _BaseSpec(bot_type, chromium_config, disable_tests, |
| 22 gclient_config, platform, target_bits, tests): | 22 platform, target_bits, tests): |
| 23 return { | 23 spec = { |
| 24 'bot_type': bot_type, | 24 'bot_type': bot_type, |
| 25 'chromium_apply_config' : chromium_apply_config, | 25 'chromium_config': chromium_config, |
| 26 'chromium_config': 'chromium_official', | |
| 27 'chromium_config_kwargs': { | 26 'chromium_config_kwargs': { |
| 28 'BUILD_CONFIG': 'Release', | 27 'BUILD_CONFIG': 'Release', |
| 29 'TARGET_BITS': target_bits, | 28 'TARGET_BITS': target_bits, |
| 30 }, | 29 }, |
| 31 'disable_tests': disable_tests, | 30 'disable_tests': disable_tests, |
| 32 'gclient_config': gclient_config, | 31 'gclient_config': 'chromium_perf', |
| 33 'testing': { | 32 'testing': { |
| 34 'platform': 'linux' if platform == 'android' else platform, | 33 'platform': 'linux' if platform == 'android' else platform, |
| 35 }, | 34 }, |
| 36 'tests': tests, | 35 'tests': tests, |
| 37 } | 36 } |
| 38 | 37 |
| 38 if platform == 'android': |
| 39 spec['android_config'] = 'chromium_perf' |
| 40 spec['chromium_apply_config'] = ['android'] |
| 41 spec['chromium_config_kwargs']['TARGET_ARCH'] = 'arm' |
| 42 spec['chromium_config_kwargs']['TARGET_PLATFORM'] = 'android' |
| 43 spec['gclient_apply_config'] = ['android'] |
| 39 | 44 |
| 40 def BuildSpec(perf_id, platform, target_bits): | 45 return spec |
| 46 |
| 47 |
| 48 def BuildSpec(chromium_config, perf_id, platform, target_bits): |
| 41 if platform == 'android': | 49 if platform == 'android': |
| 50 # TODO: Run sizes on Android. |
| 42 tests = [] | 51 tests = [] |
| 43 else: | 52 else: |
| 44 tests = [steps.SizesStep('https://chromeperf.appspot.com', perf_id)] | 53 tests = [steps.SizesStep('https://chromeperf.appspot.com', perf_id)] |
| 45 | 54 |
| 46 spec = _BaseSpec( | 55 spec = _BaseSpec( |
| 47 bot_type='builder', | 56 bot_type='builder', |
| 48 chromium_apply_config=['mb', 'chromium_perf', 'goma_hermetic_fallback'], | 57 chromium_config=chromium_config, |
| 49 disable_tests=True, | 58 disable_tests=True, |
| 50 gclient_config='chromium', | |
| 51 platform=platform, | 59 platform=platform, |
| 52 target_bits=target_bits, | 60 target_bits=target_bits, |
| 53 tests=tests) | 61 tests=tests) |
| 54 | 62 |
| 55 if platform == 'android': | 63 spec['compile_targets'] = ['chromium_builder_perf'] |
| 56 spec['chromium_apply_config'].append('android') | |
| 57 spec['chromium_config_kwargs']['TARGET_ARCH'] = 'arm' | |
| 58 spec['gclient_apply_config'] = ['android', 'perf'] | |
| 59 else: | |
| 60 spec['compile_targets'] = ['chromium_builder_perf'] | |
| 61 spec['gclient_apply_config'] = ['chrome_internal'] | |
| 62 | 64 |
| 63 return spec | 65 return spec |
| 64 | 66 |
| 65 | 67 |
| 66 def _TestSpec(parent_builder, perf_id, platform, target_bits, max_battery_temp, | 68 def _TestSpec(chromium_config, parent_builder, perf_id, platform, target_bits, |
| 67 shard_index, num_host_shards, num_device_shards, | 69 max_battery_temp, shard_index, num_host_shards, num_device_shards, |
| 68 known_devices_file): | 70 known_devices_file): |
| 69 spec = _BaseSpec( | 71 spec = _BaseSpec( |
| 70 bot_type='tester', | 72 bot_type='tester', |
| 71 chromium_apply_config=['chromium_perf'], | 73 chromium_config=chromium_config, |
| 72 disable_tests=platform == 'android', | 74 disable_tests=platform == 'android', |
| 73 gclient_config='perf', | |
| 74 platform=platform, | 75 platform=platform, |
| 75 target_bits=target_bits, | 76 target_bits=target_bits, |
| 76 tests=[steps.DynamicPerfTests( | 77 tests=[steps.DynamicPerfTests( |
| 77 perf_id, platform, target_bits, max_battery_temp=max_battery_temp, | 78 perf_id, platform, target_bits, max_battery_temp=max_battery_temp, |
| 78 num_device_shards=num_device_shards, num_host_shards=num_host_shards, | 79 num_device_shards=num_device_shards, num_host_shards=num_host_shards, |
| 79 shard_index=shard_index, known_devices_file=known_devices_file)], | 80 shard_index=shard_index, known_devices_file=known_devices_file)], |
| 80 ) | 81 ) |
| 81 | 82 |
| 82 spec['parent_buildername'] = parent_builder | 83 spec['parent_buildername'] = parent_builder |
| 83 spec['perf-id'] = perf_id | 84 spec['perf-id'] = perf_id |
| 84 spec['results-url'] = 'https://chromeperf.appspot.com' | 85 spec['results-url'] = 'https://chromeperf.appspot.com' |
| 85 | 86 |
| 86 if platform == 'android': | 87 if platform != 'android': |
| 87 spec['android_config'] = 'perf' | 88 # TODO: Remove disable_tests and run test_generators on Android. |
| 88 spec['chromium_config_kwargs']['TARGET_PLATFORM'] = 'android' | |
| 89 spec['gclient_apply_config'] = ['android'] | |
| 90 else: | |
| 91 spec['test_generators'] = [steps.generate_script] | 89 spec['test_generators'] = [steps.generate_script] |
| 92 spec['test_spec_file'] = 'chromium.perf.json' | 90 spec['test_spec_file'] = 'chromium.perf.json' |
| 93 | 91 |
| 94 return spec | 92 return spec |
| 95 | 93 |
| 96 | 94 |
| 97 def _AddBuildSpec(name, platform, target_bits=64): | 95 def _AddBuildSpec(name, platform, target_bits=64): |
| 98 if target_bits == 64: | 96 if target_bits == 64: |
| 99 perf_id = platform | 97 perf_id = platform |
| 100 else: | 98 else: |
| 101 perf_id = '%s-%d' % (platform, target_bits) | 99 perf_id = '%s-%d' % (platform, target_bits) |
| 102 | 100 |
| 103 SPEC['builders'][name] = BuildSpec(perf_id, platform, target_bits) | 101 SPEC['builders'][name] = BuildSpec( |
| 102 'chromium_perf', perf_id, platform, target_bits) |
| 104 assert target_bits not in _builders[platform] | 103 assert target_bits not in _builders[platform] |
| 105 _builders[platform][target_bits] = name | 104 _builders[platform][target_bits] = name |
| 106 | 105 |
| 107 | 106 |
| 108 def _AddTestSpec(name, perf_id, platform, target_bits=64, | 107 def _AddTestSpec(name, perf_id, platform, target_bits=64, |
| 109 max_battery_temp=350, num_host_shards=1, num_device_shards=1, | 108 max_battery_temp=350, num_host_shards=1, num_device_shards=1, |
| 110 known_devices_file='.known_devices'): | 109 known_devices_file='.known_devices'): |
| 111 parent_builder = _builders[platform][target_bits] | 110 parent_builder = _builders[platform][target_bits] |
| 112 for shard_index in xrange(num_host_shards): | 111 for shard_index in xrange(num_host_shards): |
| 113 builder_name = '%s (%d)' % (name, shard_index + 1) | 112 builder_name = '%s (%d)' % (name, shard_index + 1) |
| 114 SPEC['builders'][builder_name] = _TestSpec( | 113 SPEC['builders'][builder_name] = _TestSpec( |
| 115 parent_builder, perf_id, platform, target_bits, max_battery_temp, | 114 'chromium_perf', parent_builder, perf_id, platform, target_bits, |
| 116 shard_index, num_host_shards, num_device_shards, known_devices_file) | 115 max_battery_temp, shard_index, num_host_shards, num_device_shards, |
| 116 known_devices_file) |
| 117 | 117 |
| 118 | 118 |
| 119 _AddBuildSpec('Android Builder', 'android', target_bits=32) | 119 _AddBuildSpec('Android Builder', 'android', target_bits=32) |
| 120 _AddBuildSpec('Android arm64 Builder', 'android') | 120 _AddBuildSpec('Android arm64 Builder', 'android') |
| 121 _AddBuildSpec('Win Builder', 'win', target_bits=32) | 121 _AddBuildSpec('Win Builder', 'win', target_bits=32) |
| 122 _AddBuildSpec('Win x64 Builder', 'win') | 122 _AddBuildSpec('Win x64 Builder', 'win') |
| 123 _AddBuildSpec('Mac Builder', 'mac') | 123 _AddBuildSpec('Mac Builder', 'mac') |
| 124 _AddBuildSpec('Linux Builder', 'linux') | 124 _AddBuildSpec('Linux Builder', 'linux') |
| 125 | 125 |
| 126 | 126 |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 _AddTestSpec('Mac 10.10 Perf', 'chromium-rel-mac10', 'mac', | 165 _AddTestSpec('Mac 10.10 Perf', 'chromium-rel-mac10', 'mac', |
| 166 num_host_shards=5) | 166 num_host_shards=5) |
| 167 _AddTestSpec('Mac Retina Perf', 'chromium-rel-mac-retina', 'mac', | 167 _AddTestSpec('Mac Retina Perf', 'chromium-rel-mac-retina', 'mac', |
| 168 num_host_shards=5) | 168 num_host_shards=5) |
| 169 _AddTestSpec('Mac HDD Perf', 'chromium-rel-mac-hdd', 'mac', | 169 _AddTestSpec('Mac HDD Perf', 'chromium-rel-mac-hdd', 'mac', |
| 170 num_host_shards=5) | 170 num_host_shards=5) |
| 171 | 171 |
| 172 | 172 |
| 173 _AddTestSpec('Linux Perf', 'linux-release', 'linux', | 173 _AddTestSpec('Linux Perf', 'linux-release', 'linux', |
| 174 num_host_shards=5) | 174 num_host_shards=5) |
| OLD | NEW |