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 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 config, sort_keys=True, indent=2, separators=(',', ': ')) + '\n' | 138 config, sort_keys=True, indent=2, separators=(',', ': ')) + '\n' |
139 if content != expected: | 139 if content != expected: |
140 result = 1 | 140 result = 1 |
141 if args.write or args.convert: | 141 if args.write or args.convert: |
142 with open(filepath, 'wb') as f: | 142 with open(filepath, 'wb') as f: |
143 f.write(expected) | 143 f.write(expected) |
144 if args.write: | 144 if args.write: |
145 print('Updated %s' % filename) | 145 print('Updated %s' % filename) |
146 else: | 146 else: |
147 print('%s is not in canonical format' % filename) | 147 print('%s is not in canonical format' % filename) |
| 148 print('run `testing/buildbot/manage.py -w` to fix') |
148 | 149 |
149 if args.remaining: | 150 if args.remaining: |
150 if args.test_name: | 151 if args.test_name: |
151 if args.test_name not in tests_location: | 152 if args.test_name not in tests_location: |
152 print('Unknown test %s' % args.test_name) | 153 print('Unknown test %s' % args.test_name) |
153 return 1 | 154 return 1 |
154 for config, builders in sorted( | 155 for config, builders in sorted( |
155 tests_location[args.test_name]['local_configs'].iteritems()): | 156 tests_location[args.test_name]['local_configs'].iteritems()): |
156 print('%s:' % config) | 157 print('%s:' % config) |
157 for builder in sorted(builders): | 158 for builder in sorted(builders): |
(...skipping 26 matching lines...) Expand all Loading... |
184 p_swarming = 100. * total_swarming / total | 185 p_swarming = 100. * total_swarming / total |
185 print('%s%-*s %4d (%4.1f%%) %4d (%4.1f%%)' % | 186 print('%s%-*s %4d (%4.1f%%) %4d (%4.1f%%)' % |
186 (colorama.Fore.WHITE, l, 'Total:', total_local, p_local, | 187 (colorama.Fore.WHITE, l, 'Total:', total_local, p_local, |
187 total_swarming, p_swarming)) | 188 total_swarming, p_swarming)) |
188 print('%-*s %4d' % (l, 'Total executions:', total)) | 189 print('%-*s %4d' % (l, 'Total executions:', total)) |
189 return result | 190 return result |
190 | 191 |
191 | 192 |
192 if __name__ == "__main__": | 193 if __name__ == "__main__": |
193 sys.exit(main()) | 194 sys.exit(main()) |
OLD | NEW |