Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(363)

Side by Side Diff: testing/buildbot/manage.py

Issue 2352473002: Re-land "Update MB to use `gn analyze`." (Closed)
Patch Set: remove testing changes Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « testing/buildbot/gn_isolate_map.pyl ('k') | tools/mb/mb.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright 2015 The Chromium Authors. All rights reserved. 2 # Copyright 2015 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 """Toolbox to manage all the json files in this directory. 6 """Toolbox to manage all the json files in this directory.
7 7
8 It can reformat them in their canonical format or ensures they are well 8 It can reformat them in their canonical format or ensures they are well
9 formatted. 9 formatted.
10 """ 10 """
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 'Win8 Aura', 125 'Win8 Aura',
126 126
127 # One off builders. Note that Swarming does support ARM. 127 # One off builders. Note that Swarming does support ARM.
128 'Linux ARM Cross-Compile', 128 'Linux ARM Cross-Compile',
129 'Site Isolation Linux', 129 'Site Isolation Linux',
130 'Site Isolation Win', 130 'Site Isolation Win',
131 } 131 }
132 132
133 133
134 SKIP_GN_ISOLATE_MAP_TARGETS = { 134 SKIP_GN_ISOLATE_MAP_TARGETS = {
135 # TODO(GYP): These targets have not been ported to GN yet. 135 # This target is magic and not present in gn_isolate_map.pyl.
136 'android_webview_unittests', 136 'all',
137 'angle_deqp_gles2_tests',
138 'angle_deqp_gles3_tests',
139 'cast_media_unittests',
140 'cast_shell_browser_test',
141 'chromevox_tests',
142 'nacl_helper_nonsfi_unittests',
143 137
144 # TODO(kbr): teach this script about isolated_scripts tests. 138 # These targets are listed only in build-side recipes.
145 # crbug.com/620531 139 'All_syzygy',
146 'telemetry_gpu_integration_test', 140 'aura_builder',
147 'telemetry_gpu_test', 141 'blink_tests',
148 'telemetry_gpu_unittests', 142 'cast_shell',
149 'telemetry_perf_tests', 143 'cast_shell_apk',
150 'telemetry_perf_unittests', 144 'chrome_official_builder_no_unittests',
151 'telemetry_unittests', 145 'chromium_builder_asan',
146 'chromium_builder_dbg_drmemory_win',
147 'chromium_builder_lkgr_drmemory_win',
148 'chromium_builder_perf',
149 'chromium_builder_tests',
150 'chromium_swarm_tests',
151 'chromiumos_preflight',
152 'ios_chrome_unittests',
153 'ios_net_unittests',
154 'ios_web_inttests',
155 'ios_web_unittests',
156 'mini_installer',
157 'next_version_mini_installer',
158
159 # These are listed in Builders that are skipped for other reasons.
160 'chrome_junit_tests',
161 'components_invalidation_impl_junit_tests',
162 'components_policy_junit_tests',
163 'components_web_restrictions_junit_tests',
164 'content_junit_tests',
165 'content_junit_tests',
166 'junit_unit_tests',
167 'net_junit_tests',
168 'net_junit_tests',
169 'ui_junit_tests',
170 'webapk_client_junit_tests',
171 'webapk_shell_apk_junit_tests',
152 172
153 # These tests are only run on WebRTC CI. 173 # These tests are only run on WebRTC CI.
154 'audio_decoder_unittests', 174 'audio_decoder_unittests',
155 'common_audio_unittests', 175 'common_audio_unittests',
156 'common_video_unittests', 176 'common_video_unittests',
177 'frame_analyzer',
157 'modules_tests', 178 'modules_tests',
158 'modules_unittests', 179 'modules_unittests',
159 'peerconnection_unittests', 180 'peerconnection_unittests',
160 'rtc_media_unittests', 181 'rtc_media_unittests',
161 'rtc_pc_unittests', 182 'rtc_pc_unittests',
162 'rtc_unittests', 183 'rtc_unittests',
163 'system_wrappers_unittests', 184 'system_wrappers_unittests',
164 'test_support_unittests', 185 'test_support_unittests',
165 'tools_unittests', 186 'tools_unittests',
166 'video_engine_tests', 187 'video_engine_tests',
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
226 config = json.loads(content) 247 config = json.loads(content)
227 except ValueError as e: 248 except ValueError as e:
228 raise Error('Exception raised while checking %s: %s' % (filepath, e)) 249 raise Error('Exception raised while checking %s: %s' % (filepath, e))
229 250
230 for builder, data in sorted(config.iteritems()): 251 for builder, data in sorted(config.iteritems()):
231 if builder in SKIP: 252 if builder in SKIP:
232 # Oddities. 253 # Oddities.
233 continue 254 continue
234 if not isinstance(data, dict): 255 if not isinstance(data, dict):
235 raise Error('%s: %s is broken: %s' % (filename, builder, data)) 256 raise Error('%s: %s is broken: %s' % (filename, builder, data))
236 if 'gtest_tests' not in data: 257 if ('gtest_tests' not in data and
258 'isolated_scripts' not in data and
259 'additional_compile_targets' not in data):
237 continue 260 continue
238 if not isinstance(data['gtest_tests'], list): 261
262 for d in data.get('junit_tests', []):
263 test = d['test']
264 if (test not in ninja_targets and
265 test not in SKIP_GN_ISOLATE_MAP_TARGETS):
266 raise Error('%s: %s / %s is not listed in gn_isolate_map.pyl' %
267 (filename, builder, test))
268 elif test in ninja_targets:
269 ninja_targets_seen.add(test)
270
271 for target in data.get('additional_compile_targets', []):
272 if (target not in ninja_targets and
273 target not in SKIP_GN_ISOLATE_MAP_TARGETS):
274 raise Error('%s: %s / %s is not listed in gn_isolate_map.pyl' %
275 (filename, builder, target))
276 elif target in ninja_targets:
277 ninja_targets_seen.add(target)
278
279 gtest_tests = data.get('gtest_tests', [])
280 if not isinstance(gtest_tests, list):
239 raise Error( 281 raise Error(
240 '%s: %s is broken: %s' % (filename, builder, data['gtest_tests'])) 282 '%s: %s is broken: %s' % (filename, builder, gtest_tests))
241 if not all(isinstance(g, dict) for g in data['gtest_tests']): 283 if not all(isinstance(g, dict) for g in gtest_tests):
242 raise Error( 284 raise Error(
243 '%s: %s is broken: %s' % (filename, builder, data['gtest_tests'])) 285 '%s: %s is broken: %s' % (filename, builder, gtest_tests))
244 286
245 seen = set() 287 seen = set()
246 for d in data['gtest_tests']: 288 for d in gtest_tests:
247 if (d['test'] not in ninja_targets and 289 test = d['test']
248 d['test'] not in SKIP_GN_ISOLATE_MAP_TARGETS): 290 if (test not in ninja_targets and
291 test not in SKIP_GN_ISOLATE_MAP_TARGETS):
249 raise Error('%s: %s / %s is not listed in gn_isolate_map.pyl.' % 292 raise Error('%s: %s / %s is not listed in gn_isolate_map.pyl.' %
250 (filename, builder, d['test'])) 293 (filename, builder, test))
251 elif d['test'] in ninja_targets: 294 elif test in ninja_targets:
252 ninja_targets_seen.add(d['test']) 295 ninja_targets_seen.add(test)
253 296
254 name = d.get('name', d['test']) 297 name = d.get('name', d['test'])
255 if name in seen: 298 if name in seen:
256 raise Error('%s: %s / %s is listed multiple times.' % 299 raise Error('%s: %s / %s is listed multiple times.' %
257 (filename, builder, name)) 300 (filename, builder, name))
258 seen.add(name) 301 seen.add(name)
259 d.setdefault('swarming', {}).setdefault( 302 d.setdefault('swarming', {}).setdefault(
260 'can_use_on_swarming_builders', False) 303 'can_use_on_swarming_builders', False)
261 304
262 config[builder]['gtest_tests'] = sorted( 305 if gtest_tests:
263 data['gtest_tests'], key=lambda x: x['test']) 306 config[builder]['gtest_tests'] = sorted(
307 gtest_tests, key=lambda x: x['test'])
308
309 for d in data.get('isolated_scripts', []):
310 name = d['isolate_name']
311 if (name not in ninja_targets and
312 name not in SKIP_GN_ISOLATE_MAP_TARGETS):
313 raise Error('%s: %s / %s is not listed in gn_isolate_map.pyl.' %
314 (filename, builder, name))
315 elif name in ninja_targets:
316 ninja_targets_seen.add(name)
264 317
265 # The trick here is that process_builder_remaining() is called before 318 # The trick here is that process_builder_remaining() is called before
266 # process_builder_convert() so tests_location can be used to know how many 319 # process_builder_convert() so tests_location can be used to know how many
267 # tests were converted. 320 # tests were converted.
268 if mode in ('convert', 'remaining'): 321 if mode in ('convert', 'remaining'):
269 process_builder_remaining(data, filename, builder, tests_location) 322 process_builder_remaining(data, filename, builder, tests_location)
270 if mode == 'convert': 323 if mode == 'convert':
271 process_builder_convert(data, test_name) 324 process_builder_convert(data, test_name)
272 325
273 expected = json.dumps( 326 expected = json.dumps(
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
411 elif args.mode == 'remaining': 464 elif args.mode == 'remaining':
412 print_remaining(args.test_name, tests_location) 465 print_remaining(args.test_name, tests_location)
413 return result 466 return result
414 except Error as e: 467 except Error as e:
415 sys.stderr.write('%s\n' % e) 468 sys.stderr.write('%s\n' % e)
416 return 1 469 return 1
417 470
418 471
419 if __name__ == "__main__": 472 if __name__ == "__main__":
420 sys.exit(main()) 473 sys.exit(main())
OLDNEW
« no previous file with comments | « testing/buildbot/gn_isolate_map.pyl ('k') | tools/mb/mb.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698