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 'test_spec_file': 'chromium.perf.json', | |
29 }, | 32 }, |
30 'Android Nexus5 Perf': { | 33 'Android Nexus5 Perf': { |
31 'perf_id': 'android-nexus5', | 34 'perf_id': 'android-nexus5', |
32 'bucket': 'chrome-perf', | 35 'bucket': 'chrome-perf', |
33 'path': lambda api: ('android_perf_rel/full-build-linux_%s.zip' % | 36 'path': lambda api: ('android_perf_rel/full-build-linux_%s.zip' % |
34 api.properties['parent_revision']), | 37 api.properties['parent_revision']), |
35 'num_device_shards': 8, | 38 'num_device_shards': 8, |
39 'test_spec_file': 'chromium.perf.json', | |
36 }, | 40 }, |
37 'Android Nexus7v2 Perf': { | 41 'Android Nexus7v2 Perf': { |
38 'perf_id': 'android-nexus7v2', | 42 'perf_id': 'android-nexus7v2', |
39 'bucket': 'chrome-perf', | 43 'bucket': 'chrome-perf', |
40 'path': lambda api: ('android_perf_rel/full-build-linux_%s.zip' % | 44 'path': lambda api: ('android_perf_rel/full-build-linux_%s.zip' % |
41 api.properties['parent_revision']), | 45 api.properties['parent_revision']), |
42 'num_device_shards': 8, | 46 'num_device_shards': 8, |
47 'test_spec_file': 'chromium.perf.json', | |
43 }, | 48 }, |
44 'Android Nexus10 Perf': { | 49 'Android Nexus10 Perf': { |
45 'perf_id': 'android-nexus10', | 50 'perf_id': 'android-nexus10', |
46 'bucket': 'chrome-perf', | 51 'bucket': 'chrome-perf', |
47 'path': lambda api: ('android_perf_rel/full-build-linux_%s.zip' % | 52 'path': lambda api: ('android_perf_rel/full-build-linux_%s.zip' % |
48 api.properties['parent_revision']), | 53 api.properties['parent_revision']), |
49 'num_device_shards': 8, | 54 'num_device_shards': 8, |
55 'test_spec_file': 'chromium.perf.json', | |
50 }, | 56 }, |
51 'Android MotoE Perf': { | 57 'Android MotoE Perf': { |
52 'perf_id': 'android-motoe', | 58 'perf_id': 'android-motoe', |
53 'bucket': 'chrome-perf', | 59 'bucket': 'chrome-perf', |
54 'path': lambda api: ('android_perf_rel/full-build-linux_%s.zip' % | 60 'path': lambda api: ('android_perf_rel/full-build-linux_%s.zip' % |
55 api.properties['parent_revision']), | 61 api.properties['parent_revision']), |
56 'num_device_shards': 8, | 62 'num_device_shards': 8, |
63 'test_spec_file': 'chromium.perf.json', | |
57 }, | 64 }, |
58 }, | 65 }, |
59 'chromium.perf.fyi': { | 66 'chromium.perf.fyi': { |
60 'android_nexus5_oilpan_perf': { | 67 'android_nexus5_oilpan_perf': { |
61 'perf_id': 'android-nexus5-oilpan', | 68 'perf_id': 'android-nexus5-oilpan', |
62 'bucket': 'chromium-android', | 69 'bucket': 'chromium-android', |
63 'path': lambda api: ( | 70 'path': lambda api: ( |
64 '%s/build_product_%s.zip' % ( | 71 '%s/build_product_%s.zip' % ( |
65 api.properties['parent_buildername'], | 72 api.properties['parent_buildername'], |
66 api.properties['parent_revision'])), | 73 api.properties['parent_revision'])), |
(...skipping 13 matching lines...) Expand all Loading... | |
80 api.properties['parent_revision']), | 87 api.properties['parent_revision']), |
81 'num_device_shards': 1, | 88 'num_device_shards': 1, |
82 'set_component_rev': {'name': 'src/v8', 'rev_str': '%s'}, | 89 'set_component_rev': {'name': 'src/v8', 'rev_str': '%s'}, |
83 }, | 90 }, |
84 }, | 91 }, |
85 }) | 92 }) |
86 | 93 |
87 def GenSteps(api): | 94 def GenSteps(api): |
88 mastername = api.properties['mastername'] | 95 mastername = api.properties['mastername'] |
89 buildername = api.properties['buildername'] | 96 buildername = api.properties['buildername'] |
90 builder = BUILDERS[mastername][buildername] | 97 builder = thaw(BUILDERS[mastername][buildername]) |
91 api.chromium_android.configure_from_properties('base_config', | 98 api.chromium_android.configure_from_properties('base_config', |
92 REPO_NAME='src', | 99 REPO_NAME='src', |
93 REPO_URL=REPO_URL, | 100 REPO_URL=REPO_URL, |
94 INTERNAL=False, | 101 INTERNAL=False, |
95 BUILD_CONFIG='Release') | 102 BUILD_CONFIG='Release', |
103 TARGET_PLATFORM='android') | |
96 api.gclient.set_config('perf') | 104 api.gclient.set_config('perf') |
97 api.gclient.apply_config('android') | 105 api.gclient.apply_config('android') |
98 for c in builder.get('gclient_apply_config', []): | 106 for c in builder.get('gclient_apply_config', []): |
99 api.gclient.apply_config(c) | 107 api.gclient.apply_config(c) |
100 | 108 |
101 if builder.get('set_component_rev'): | 109 if builder.get('set_component_rev'): |
102 # If this is a component build and the main revision is e.g. blink, | 110 # 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 | 111 # webrtc, or v8, the custom deps revision of this component must be |
104 # dynamically set to either: | 112 # dynamically set to either: |
105 # (1) the revision of the builder, | 113 # (1) the revision of the builder, |
106 # (2) 'revision' from the waterfall, or | 114 # (2) 'revision' from the waterfall, or |
107 # (3) 'HEAD' for forced builds with unspecified 'revision'. | 115 # (3) 'HEAD' for forced builds with unspecified 'revision'. |
108 # TODO(machenbach): Use parent_got_cr_revision on testers with component | 116 # TODO(machenbach): Use parent_got_cr_revision on testers with component |
109 # builds to match also the chromium revision from the builder. | 117 # builds to match also the chromium revision from the builder. |
110 component_rev = api.properties.get( | 118 component_rev = api.properties.get( |
111 'parent_got_revision', api.properties.get('revision') or 'HEAD') | 119 'parent_got_revision', api.properties.get('revision') or 'HEAD') |
112 dep = builder.get('set_component_rev') | 120 dep = builder.get('set_component_rev') |
113 api.gclient.c.revisions[dep['name']] = dep['rev_str'] % component_rev | 121 api.gclient.c.revisions[dep['name']] = dep['rev_str'] % component_rev |
114 | 122 |
115 api.bot_update.ensure_checkout() | 123 api.bot_update.ensure_checkout() |
124 | |
125 test_spec_file = builder.get('test_spec_file') | |
126 test_spec = {} | |
127 if test_spec_file: | |
128 test_spec_path = api.path['checkout'].join('testing', 'buildbot', | |
Paweł Hajdan Jr.
2015/02/11 08:24:03
This seems to be duplicating already existing code
shatch
2015/02/12 20:46:32
Moved this into chromium_tests, since there's alre
| |
129 test_spec_file) | |
130 test_spec_result = api.json.read( | |
131 'read test spec', | |
132 test_spec_path, | |
133 step_test_data=lambda: api.json.test_api.output({})) | |
134 test_spec_result.presentation.step_text = 'path: %s' % test_spec_path | |
135 test_spec = test_spec_result.json.output | |
136 | |
137 scripts_compile_targets = \ | |
138 api.chromium.get_compile_targets_for_scripts().json.output | |
139 | |
140 for generator in [api.chromium.steps.generate_script]: | |
141 builder.setdefault('tests', []) | |
142 builder['tests'] = ( | |
143 list(generator(api, mastername, buildername, test_spec, | |
144 enable_swarming=False, | |
145 scripts_compile_targets=scripts_compile_targets)) + | |
146 builder['tests']) | |
147 | |
116 api.path['checkout'] = api.path['slave_build'].join('src') | 148 api.path['checkout'] = api.path['slave_build'].join('src') |
117 api.chromium_android.clean_local_files() | 149 api.chromium_android.clean_local_files() |
118 | 150 |
119 api.chromium_android.download_build(bucket=builder['bucket'], | 151 api.chromium_android.download_build(bucket=builder['bucket'], |
120 path=builder['path'](api)) | 152 path=builder['path'](api)) |
121 | 153 |
122 api.chromium_android.common_tests_setup_steps() | 154 api.chromium_android.common_tests_setup_steps() |
123 | 155 |
124 api.chromium_android.adb_install_apk( | 156 api.chromium_android.adb_install_apk( |
125 'ChromeShell.apk', | 157 'ChromeShell.apk', |
126 'org.chromium.chrome.shell') | 158 'org.chromium.chrome.shell') |
127 | 159 |
160 test_runner = api.chromium_tests.create_test_runner( | |
161 api, builder.get('tests', [])) | |
162 | |
128 perf_tests = api.chromium.list_perf_tests( | 163 perf_tests = api.chromium.list_perf_tests( |
129 browser='android-chrome-shell', | 164 browser='android-chrome-shell', |
130 num_shards=builder['num_device_shards'], | 165 num_shards=builder['num_device_shards'], |
131 devices=api.chromium_android.devices[0:1]).json.output | 166 devices=api.chromium_android.devices[0:1]).json.output |
132 | |
133 try: | 167 try: |
168 if test_runner: | |
169 test_runner() | |
134 api.chromium_android.run_sharded_perf_tests( | 170 api.chromium_android.run_sharded_perf_tests( |
135 config=api.json.input(data=perf_tests), | 171 config=api.json.input(data=perf_tests), |
136 perf_id=builder['perf_id'], | 172 perf_id=builder['perf_id'], |
137 chartjson_file=True) | 173 chartjson_file=True) |
138 | |
139 finally: | 174 finally: |
140 api.chromium_android.common_tests_final_steps() | 175 api.chromium_android.common_tests_final_steps() |
141 | 176 |
142 def _sanitize_nonalpha(text): | 177 def _sanitize_nonalpha(text): |
143 return ''.join(c if c.isalnum() else '_' for c in text) | 178 return ''.join(c if c.isalnum() else '_' for c in text) |
144 | 179 |
145 def GenTests(api): | 180 def GenTests(api): |
146 for mastername, builders in BUILDERS.iteritems(): | 181 for mastername, builders in BUILDERS.iteritems(): |
147 for buildername in builders: | 182 for buildername in builders: |
148 yield ( | 183 yield ( |
(...skipping 16 matching lines...) Expand all Loading... | |
165 repo_url=REPO_URL, | 200 repo_url=REPO_URL, |
166 mastername='chromium.perf', | 201 mastername='chromium.perf', |
167 buildername='Android Nexus5 Perf', | 202 buildername='Android Nexus5 Perf', |
168 parent_buildername='parent_buildername', | 203 parent_buildername='parent_buildername', |
169 parent_buildnumber='1729', | 204 parent_buildnumber='1729', |
170 parent_revision='deadbeef', | 205 parent_revision='deadbeef', |
171 revision='deadbeef', | 206 revision='deadbeef', |
172 slavename='slavename', | 207 slavename='slavename', |
173 target='Release') | 208 target='Release') |
174 + api.step_data('provision_devices', retcode=1)) | 209 + api.step_data('provision_devices', retcode=1)) |
OLD | NEW |