Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 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 from infra.libs.infra_types import freeze | 5 from infra.libs.infra_types import freeze, thaw |
| 6 | 6 |
| 7 DEPS = [ | 7 DEPS = [ |
| 8 'adb', | 8 'adb', |
| 9 'bot_update', | 9 'bot_update', |
| 10 'chromium', | 10 'chromium', |
| 11 'chromium_android', | 11 'chromium_android', |
| 12 'chromium_tests', | |
| 12 'gclient', | 13 'gclient', |
| 13 'json', | 14 'json', |
| 14 'step', | 15 'step', |
| 15 'path', | 16 'path', |
| 16 'properties', | 17 'properties', |
| 18 'python', | |
| 17 ] | 19 ] |
| 18 | 20 |
| 19 REPO_URL = 'https://chromium.googlesource.com/chromium/src.git' | 21 REPO_URL = 'https://chromium.googlesource.com/chromium/src.git' |
| 20 | 22 |
| 21 BUILDERS = freeze({ | 23 BUILDERS = freeze({ |
| 22 'chromium.perf': { | 24 'chromium.perf': { |
| 23 'Android Nexus4 Perf': { | 25 'Android Nexus4 Perf': { |
| 24 'perf_id': 'android-nexus4', | 26 'perf_id': 'android-nexus4', |
| 25 'bucket': 'chrome-perf', | 27 'bucket': 'chrome-perf', |
| 26 'path': lambda api: ('android_perf_rel/full-build-linux_%s.zip' % | 28 'path': lambda api: ('android_perf_rel/full-build-linux_%s.zip' % |
| 27 api.properties['parent_revision']), | 29 api.properties['parent_revision']), |
| 28 'num_device_shards': 8, | 30 'num_device_shards': 8, |
| 31 'testing': { | |
| 32 'platform': 'linux', | |
| 33 'test_spec_file': 'chromium.perf.json', | |
| 34 }, | |
| 29 }, | 35 }, |
| 30 'Android Nexus5 Perf': { | 36 'Android Nexus5 Perf': { |
| 31 'perf_id': 'android-nexus5', | 37 'perf_id': 'android-nexus5', |
| 32 'bucket': 'chrome-perf', | 38 'bucket': 'chrome-perf', |
| 33 'path': lambda api: ('android_perf_rel/full-build-linux_%s.zip' % | 39 'path': lambda api: ('android_perf_rel/full-build-linux_%s.zip' % |
| 34 api.properties['parent_revision']), | 40 api.properties['parent_revision']), |
| 35 'num_device_shards': 8, | 41 'num_device_shards': 8, |
| 42 'testing': { | |
| 43 'platform': 'linux', | |
| 44 'test_spec_file': 'chromium.perf.json', | |
| 45 }, | |
| 36 }, | 46 }, |
| 37 'Android Nexus7v2 Perf': { | 47 'Android Nexus7v2 Perf': { |
| 38 'perf_id': 'android-nexus7v2', | 48 'perf_id': 'android-nexus7v2', |
| 39 'bucket': 'chrome-perf', | 49 'bucket': 'chrome-perf', |
| 40 'path': lambda api: ('android_perf_rel/full-build-linux_%s.zip' % | 50 'path': lambda api: ('android_perf_rel/full-build-linux_%s.zip' % |
| 41 api.properties['parent_revision']), | 51 api.properties['parent_revision']), |
| 42 'num_device_shards': 8, | 52 'num_device_shards': 8, |
| 53 'testing': { | |
| 54 'platform': 'linux', | |
| 55 'test_spec_file': 'chromium.perf.json', | |
| 56 }, | |
| 43 }, | 57 }, |
| 44 'Android Nexus10 Perf': { | 58 'Android Nexus10 Perf': { |
| 45 'perf_id': 'android-nexus10', | 59 'perf_id': 'android-nexus10', |
| 46 'bucket': 'chrome-perf', | 60 'bucket': 'chrome-perf', |
| 47 'path': lambda api: ('android_perf_rel/full-build-linux_%s.zip' % | 61 'path': lambda api: ('android_perf_rel/full-build-linux_%s.zip' % |
| 48 api.properties['parent_revision']), | 62 api.properties['parent_revision']), |
| 49 'num_device_shards': 8, | 63 'num_device_shards': 8, |
| 64 'testing': { | |
| 65 'platform': 'linux', | |
| 66 'test_spec_file': 'chromium.perf.json', | |
| 67 }, | |
| 50 }, | 68 }, |
| 51 'Android MotoE Perf': { | 69 'Android MotoE Perf': { |
| 52 'perf_id': 'android-motoe', | 70 'perf_id': 'android-motoe', |
| 53 'bucket': 'chrome-perf', | 71 'bucket': 'chrome-perf', |
| 54 'path': lambda api: ('android_perf_rel/full-build-linux_%s.zip' % | 72 'path': lambda api: ('android_perf_rel/full-build-linux_%s.zip' % |
| 55 api.properties['parent_revision']), | 73 api.properties['parent_revision']), |
| 56 'num_device_shards': 8, | 74 'num_device_shards': 8, |
| 75 'testing': { | |
| 76 'platform': 'linux', | |
| 77 'test_spec_file': 'chromium.perf.json', | |
| 78 }, | |
| 57 }, | 79 }, |
| 58 }, | 80 }, |
| 59 'chromium.perf.fyi': { | 81 'chromium.perf.fyi': { |
| 60 'android_nexus5_oilpan_perf': { | 82 'android_nexus5_oilpan_perf': { |
| 61 'perf_id': 'android-nexus5-oilpan', | 83 'perf_id': 'android-nexus5-oilpan', |
| 62 'bucket': 'chromium-android', | 84 'bucket': 'chromium-android', |
| 63 'path': lambda api: ( | 85 'path': lambda api: ( |
| 64 '%s/build_product_%s.zip' % ( | 86 '%s/build_product_%s.zip' % ( |
| 65 api.properties['parent_buildername'], | 87 api.properties['parent_buildername'], |
| 66 api.properties['parent_revision'])), | 88 api.properties['parent_revision'])), |
| (...skipping 13 matching lines...) Expand all Loading... | |
| 80 api.properties['parent_revision']), | 102 api.properties['parent_revision']), |
| 81 'num_device_shards': 1, | 103 'num_device_shards': 1, |
| 82 'set_component_rev': {'name': 'src/v8', 'rev_str': '%s'}, | 104 'set_component_rev': {'name': 'src/v8', 'rev_str': '%s'}, |
| 83 }, | 105 }, |
| 84 }, | 106 }, |
| 85 }) | 107 }) |
| 86 | 108 |
| 87 def GenSteps(api): | 109 def GenSteps(api): |
| 88 mastername = api.properties['mastername'] | 110 mastername = api.properties['mastername'] |
| 89 buildername = api.properties['buildername'] | 111 buildername = api.properties['buildername'] |
| 90 builder = BUILDERS[mastername][buildername] | 112 builder = thaw(BUILDERS[mastername][buildername]) |
| 91 api.chromium_android.configure_from_properties('base_config', | 113 api.chromium_android.configure_from_properties('base_config', |
| 92 REPO_NAME='src', | 114 REPO_NAME='src', |
| 93 REPO_URL=REPO_URL, | 115 REPO_URL=REPO_URL, |
| 94 INTERNAL=False, | 116 INTERNAL=False, |
| 95 BUILD_CONFIG='Release') | 117 BUILD_CONFIG='Release') |
| 96 api.gclient.set_config('perf') | 118 api.gclient.set_config('perf') |
| 97 api.gclient.apply_config('android') | 119 api.gclient.apply_config('android') |
| 98 for c in builder.get('gclient_apply_config', []): | 120 for c in builder.get('gclient_apply_config', []): |
| 99 api.gclient.apply_config(c) | 121 api.gclient.apply_config(c) |
| 100 | 122 |
| 101 if builder.get('set_component_rev'): | 123 if builder.get('set_component_rev'): |
| 102 # If this is a component build and the main revision is e.g. blink, | 124 # If this is a component build and the main revision is e.g. blink, |
| 103 # webrtc, or v8, the custom deps revision of this component must be | 125 # webrtc, or v8, the custom deps revision of this component must be |
| 104 # dynamically set to either: | 126 # dynamically set to either: |
| 105 # (1) the revision of the builder, | 127 # (1) the revision of the builder, |
| 106 # (2) 'revision' from the waterfall, or | 128 # (2) 'revision' from the waterfall, or |
| 107 # (3) 'HEAD' for forced builds with unspecified 'revision'. | 129 # (3) 'HEAD' for forced builds with unspecified 'revision'. |
| 108 # TODO(machenbach): Use parent_got_cr_revision on testers with component | 130 # TODO(machenbach): Use parent_got_cr_revision on testers with component |
| 109 # builds to match also the chromium revision from the builder. | 131 # builds to match also the chromium revision from the builder. |
| 110 component_rev = api.properties.get( | 132 component_rev = api.properties.get( |
| 111 'parent_got_revision', api.properties.get('revision') or 'HEAD') | 133 'parent_got_revision', api.properties.get('revision') or 'HEAD') |
| 112 dep = builder.get('set_component_rev') | 134 dep = builder.get('set_component_rev') |
| 113 api.gclient.c.revisions[dep['name']] = dep['rev_str'] % component_rev | 135 api.gclient.c.revisions[dep['name']] = dep['rev_str'] % component_rev |
| 114 | 136 |
| 115 api.bot_update.ensure_checkout() | 137 api.bot_update.ensure_checkout() |
| 138 | |
| 139 test_spec_file = builder.get('testing', {}).get('test_spec_file', | |
|
shatch
2015/01/29 20:26:17
Not entirely clear why builders are specified both
| |
| 140 '%s.json' % mastername) | |
| 141 test_spec_path = api.path['checkout'].join('testing', 'buildbot', | |
| 142 test_spec_file) | |
| 143 test_spec_result = api.json.read( | |
| 144 'read test spec', | |
| 145 test_spec_path, | |
| 146 step_test_data=lambda: api.json.test_api.output({})) | |
| 147 test_spec_result.presentation.step_text = 'path: %s' % test_spec_path | |
| 148 test_spec = test_spec_result.json.output | |
| 149 | |
| 150 scripts_compile_targets = \ | |
| 151 api.chromium.get_compile_targets_for_scripts().json.output | |
| 152 | |
| 153 for generator in [api.chromium.steps.generate_script]: | |
| 154 builder.setdefault('tests', []) | |
| 155 builder['tests'] = ( | |
| 156 list(generator(api, mastername, buildername, test_spec, | |
| 157 enable_swarming=False, | |
| 158 scripts_compile_targets=scripts_compile_targets)) + | |
| 159 builder['tests']) | |
| 160 | |
| 116 api.path['checkout'] = api.path['slave_build'].join('src') | 161 api.path['checkout'] = api.path['slave_build'].join('src') |
| 117 api.chromium_android.clean_local_files() | 162 api.chromium_android.clean_local_files() |
| 118 | 163 |
| 119 api.chromium_android.download_build(bucket=builder['bucket'], | 164 api.chromium_android.download_build(bucket=builder['bucket'], |
| 120 path=builder['path'](api)) | 165 path=builder['path'](api)) |
| 121 | 166 |
| 122 api.chromium_android.common_tests_setup_steps() | 167 api.chromium_android.common_tests_setup_steps() |
| 123 | 168 |
| 124 api.chromium_android.adb_install_apk( | 169 api.chromium_android.adb_install_apk( |
| 125 'ChromeShell.apk', | 170 'ChromeShell.apk', |
| 126 'org.chromium.chrome.shell') | 171 'org.chromium.chrome.shell') |
| 127 | 172 |
| 173 test_runner = api.chromium_tests.create_test_runner( | |
| 174 api, builder.get('tests', [])) | |
| 175 | |
| 128 perf_tests = api.chromium.list_perf_tests( | 176 perf_tests = api.chromium.list_perf_tests( |
| 129 browser='android-chrome-shell', | 177 browser='android-chrome-shell', |
| 130 num_shards=builder['num_device_shards'], | 178 num_shards=builder['num_device_shards'], |
| 131 devices=api.chromium_android.devices[0:1]).json.output | 179 devices=api.chromium_android.devices[0:1]).json.output |
| 132 | |
| 133 try: | 180 try: |
| 181 if test_runner: | |
| 182 test_runner() | |
| 134 api.chromium_android.run_sharded_perf_tests( | 183 api.chromium_android.run_sharded_perf_tests( |
| 135 config=api.json.input(data=perf_tests), | 184 config=api.json.input(data=perf_tests), |
| 136 perf_id=builder['perf_id'], | 185 perf_id=builder['perf_id'], |
| 137 chartjson_file=True) | 186 chartjson_file=True) |
| 138 | |
| 139 finally: | 187 finally: |
| 140 api.chromium_android.common_tests_final_steps() | 188 api.chromium_android.common_tests_final_steps() |
| 141 | 189 |
| 142 def _sanitize_nonalpha(text): | 190 def _sanitize_nonalpha(text): |
| 143 return ''.join(c if c.isalnum() else '_' for c in text) | 191 return ''.join(c if c.isalnum() else '_' for c in text) |
| 144 | 192 |
| 145 def GenTests(api): | 193 def GenTests(api): |
| 146 for mastername, builders in BUILDERS.iteritems(): | 194 for mastername, builders in BUILDERS.iteritems(): |
| 147 for buildername in builders: | 195 for buildername in builders: |
| 148 yield ( | 196 yield ( |
| (...skipping 16 matching lines...) Expand all Loading... | |
| 165 repo_url=REPO_URL, | 213 repo_url=REPO_URL, |
| 166 mastername='chromium.perf', | 214 mastername='chromium.perf', |
| 167 buildername='Android Nexus5 Perf', | 215 buildername='Android Nexus5 Perf', |
| 168 parent_buildername='parent_buildername', | 216 parent_buildername='parent_buildername', |
| 169 parent_buildnumber='1729', | 217 parent_buildnumber='1729', |
| 170 parent_revision='deadbeef', | 218 parent_revision='deadbeef', |
| 171 revision='deadbeef', | 219 revision='deadbeef', |
| 172 slavename='slavename', | 220 slavename='slavename', |
| 173 target='Release') | 221 target='Release') |
| 174 + api.step_data('provision_devices', retcode=1)) | 222 + api.step_data('provision_devices', retcode=1)) |
| OLD | NEW |