OLD | NEW |
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 Loading... |
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 'all', | 135 # TODO(GYP): These targets have not been ported to GN yet. |
136 'chromium_swarm_tests', | 136 'android_webview_unittests', |
| 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 |
| 144 # TODO(kbr): teach this script about isolated_scripts tests. |
| 145 # crbug.com/620531 |
| 146 'telemetry_gpu_integration_test', |
| 147 'telemetry_gpu_test', |
| 148 'telemetry_gpu_unittests', |
| 149 'telemetry_perf_tests', |
| 150 'telemetry_perf_unittests', |
| 151 'telemetry_unittests', |
137 | 152 |
138 # These tests are only run on WebRTC CI. | 153 # These tests are only run on WebRTC CI. |
139 'audio_decoder_unittests', | 154 'audio_decoder_unittests', |
140 'common_audio_unittests', | 155 'common_audio_unittests', |
141 'common_video_unittests', | 156 'common_video_unittests', |
142 'frame_analyzer', | |
143 'modules_tests', | 157 'modules_tests', |
144 'modules_unittests', | 158 'modules_unittests', |
145 'peerconnection_unittests', | 159 'peerconnection_unittests', |
146 'rtc_media_unittests', | 160 'rtc_media_unittests', |
147 'rtc_pc_unittests', | 161 'rtc_pc_unittests', |
148 'rtc_unittests', | 162 'rtc_unittests', |
149 'system_wrappers_unittests', | 163 'system_wrappers_unittests', |
150 'test_support_unittests', | 164 'test_support_unittests', |
151 'tools_unittests', | 165 'tools_unittests', |
152 'video_engine_tests', | 166 'video_engine_tests', |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
212 config = json.loads(content) | 226 config = json.loads(content) |
213 except ValueError as e: | 227 except ValueError as e: |
214 raise Error('Exception raised while checking %s: %s' % (filepath, e)) | 228 raise Error('Exception raised while checking %s: %s' % (filepath, e)) |
215 | 229 |
216 for builder, data in sorted(config.iteritems()): | 230 for builder, data in sorted(config.iteritems()): |
217 if builder in SKIP: | 231 if builder in SKIP: |
218 # Oddities. | 232 # Oddities. |
219 continue | 233 continue |
220 if not isinstance(data, dict): | 234 if not isinstance(data, dict): |
221 raise Error('%s: %s is broken: %s' % (filename, builder, data)) | 235 raise Error('%s: %s is broken: %s' % (filename, builder, data)) |
222 if ('gtest_tests' not in data and | 236 if 'gtest_tests' not in data: |
223 'isolated_scripts' not in data and | |
224 'additional_compile_targets' not in data): | |
225 continue | 237 continue |
226 | 238 if not isinstance(data['gtest_tests'], list): |
227 for target in data.get('additional_compile_targets', []): | |
228 if (target not in ninja_targets and | |
229 target not in SKIP_GN_ISOLATE_MAP_TARGETS): | |
230 raise Error('%s: %s / %s is not listed in gn_isolate_map.pyl' % | |
231 (filename, builder, target)) | |
232 elif target in ninja_targets: | |
233 ninja_targets_seen.add(target) | |
234 | |
235 gtest_tests = data.get('gtest_tests', []) | |
236 if not isinstance(gtest_tests, list): | |
237 raise Error( | 239 raise Error( |
238 '%s: %s is broken: %s' % (filename, builder, gtest_tests)) | 240 '%s: %s is broken: %s' % (filename, builder, data['gtest_tests'])) |
239 if not all(isinstance(g, dict) for g in gtest_tests): | 241 if not all(isinstance(g, dict) for g in data['gtest_tests']): |
240 raise Error( | 242 raise Error( |
241 '%s: %s is broken: %s' % (filename, builder, gtest_tests)) | 243 '%s: %s is broken: %s' % (filename, builder, data['gtest_tests'])) |
242 | 244 |
243 seen = set() | 245 seen = set() |
244 for d in gtest_tests: | 246 for d in data['gtest_tests']: |
245 test = d['test'] | 247 if (d['test'] not in ninja_targets and |
246 if (test not in ninja_targets and | 248 d['test'] not in SKIP_GN_ISOLATE_MAP_TARGETS): |
247 test not in SKIP_GN_ISOLATE_MAP_TARGETS): | |
248 raise Error('%s: %s / %s is not listed in gn_isolate_map.pyl.' % | 249 raise Error('%s: %s / %s is not listed in gn_isolate_map.pyl.' % |
249 (filename, builder, test)) | 250 (filename, builder, d['test'])) |
250 elif test in ninja_targets: | 251 elif d['test'] in ninja_targets: |
251 ninja_targets_seen.add(test) | 252 ninja_targets_seen.add(d['test']) |
252 | 253 |
253 name = d.get('name', d['test']) | 254 name = d.get('name', d['test']) |
254 if name in seen: | 255 if name in seen: |
255 raise Error('%s: %s / %s is listed multiple times.' % | 256 raise Error('%s: %s / %s is listed multiple times.' % |
256 (filename, builder, name)) | 257 (filename, builder, name)) |
257 seen.add(name) | 258 seen.add(name) |
258 d.setdefault('swarming', {}).setdefault( | 259 d.setdefault('swarming', {}).setdefault( |
259 'can_use_on_swarming_builders', False) | 260 'can_use_on_swarming_builders', False) |
260 | 261 |
261 if gtest_tests: | 262 config[builder]['gtest_tests'] = sorted( |
262 config[builder]['gtest_tests'] = sorted( | 263 data['gtest_tests'], key=lambda x: x['test']) |
263 gtest_tests, key=lambda x: x['test']) | |
264 | |
265 for d in data.get('isolated_scripts', []): | |
266 name = d['isolate_name'] | |
267 if (name not in ninja_targets and | |
268 name not in SKIP_GN_ISOLATE_MAP_TARGETS): | |
269 raise Error('%s: %s / %s is not listed in gn_isolate_map.pyl.' % | |
270 (filename, builder, name)) | |
271 elif name in ninja_targets: | |
272 ninja_targets_seen.add(name) | |
273 | 264 |
274 # The trick here is that process_builder_remaining() is called before | 265 # The trick here is that process_builder_remaining() is called before |
275 # process_builder_convert() so tests_location can be used to know how many | 266 # process_builder_convert() so tests_location can be used to know how many |
276 # tests were converted. | 267 # tests were converted. |
277 if mode in ('convert', 'remaining'): | 268 if mode in ('convert', 'remaining'): |
278 process_builder_remaining(data, filename, builder, tests_location) | 269 process_builder_remaining(data, filename, builder, tests_location) |
279 if mode == 'convert': | 270 if mode == 'convert': |
280 process_builder_convert(data, test_name) | 271 process_builder_convert(data, test_name) |
281 | 272 |
282 expected = json.dumps( | 273 expected = json.dumps( |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
420 elif args.mode == 'remaining': | 411 elif args.mode == 'remaining': |
421 print_remaining(args.test_name, tests_location) | 412 print_remaining(args.test_name, tests_location) |
422 return result | 413 return result |
423 except Error as e: | 414 except Error as e: |
424 sys.stderr.write('%s\n' % e) | 415 sys.stderr.write('%s\n' % e) |
425 return 1 | 416 return 1 |
426 | 417 |
427 | 418 |
428 if __name__ == "__main__": | 419 if __name__ == "__main__": |
429 sys.exit(main()) | 420 sys.exit(main()) |
OLD | NEW |