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

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

Issue 2151503003: Make sure a test cannot be listed twice for one builder. (Closed) Base URL: https://chromium.googlesource.com/a/chromium/src.git@master
Patch Set: Created 4 years, 5 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 | « no previous file | no next file » | 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 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 raise Error('%s: %s is broken: %s' % (filename, builder, data)) 217 raise Error('%s: %s is broken: %s' % (filename, builder, data))
218 if 'gtest_tests' not in data: 218 if 'gtest_tests' not in data:
219 continue 219 continue
220 if not isinstance(data['gtest_tests'], list): 220 if not isinstance(data['gtest_tests'], list):
221 raise Error( 221 raise Error(
222 '%s: %s is broken: %s' % (filename, builder, data['gtest_tests'])) 222 '%s: %s is broken: %s' % (filename, builder, data['gtest_tests']))
223 if not all(isinstance(g, dict) for g in data['gtest_tests']): 223 if not all(isinstance(g, dict) for g in data['gtest_tests']):
224 raise Error( 224 raise Error(
225 '%s: %s is broken: %s' % (filename, builder, data['gtest_tests'])) 225 '%s: %s is broken: %s' % (filename, builder, data['gtest_tests']))
226 226
227 seen = set()
227 for d in data['gtest_tests']: 228 for d in data['gtest_tests']:
228 if (d['test'] not in ninja_targets and 229 if (d['test'] not in ninja_targets and
229 d['test'] not in SKIP_GN_ISOLATE_MAP_TARGETS): 230 d['test'] not in SKIP_GN_ISOLATE_MAP_TARGETS):
230 raise Error('%s: %s / %s is not listed in gn_isolate_map.pyl.' % 231 raise Error('%s: %s / %s is not listed in gn_isolate_map.pyl.' %
231 (filename, builder, d['test'])) 232 (filename, builder, d['test']))
232 elif d['test'] in ninja_targets: 233 elif d['test'] in ninja_targets:
233 ninja_targets_seen.add(d['test']) 234 ninja_targets_seen.add(d['test'])
234 235
236 name = d.get('name', d['test'])
237 if name in seen:
238 raise Error('%s: %s / %s is listed multiple times.' %
239 (filename, builder, name))
240 seen.add(name)
241
235 config[builder]['gtest_tests'] = sorted( 242 config[builder]['gtest_tests'] = sorted(
236 data['gtest_tests'], key=lambda x: x['test']) 243 data['gtest_tests'], key=lambda x: x['test'])
237 244
238 # The trick here is that process_builder_remaining() is called before 245 # The trick here is that process_builder_remaining() is called before
239 # process_builder_convert() so tests_location can be used to know how many 246 # process_builder_convert() so tests_location can be used to know how many
240 # tests were converted. 247 # tests were converted.
241 if mode in ('convert', 'remaining'): 248 if mode in ('convert', 'remaining'):
242 process_builder_remaining(data, filename, builder, tests_location) 249 process_builder_remaining(data, filename, builder, tests_location)
243 if mode == 'convert': 250 if mode == 'convert':
244 process_builder_convert(data, test_name) 251 process_builder_convert(data, test_name)
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
384 elif args.mode == 'remaining': 391 elif args.mode == 'remaining':
385 print_remaining(args.test_name, tests_location) 392 print_remaining(args.test_name, tests_location)
386 return result 393 return result
387 except Error as e: 394 except Error as e:
388 sys.stderr.write('%s\n' % e) 395 sys.stderr.write('%s\n' % e)
389 return 1 396 return 1
390 397
391 398
392 if __name__ == "__main__": 399 if __name__ == "__main__":
393 sys.exit(main()) 400 sys.exit(main())
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698