OLD | NEW |
---|---|
1 #! /usr/bin/env python | 1 #! /usr/bin/env python |
2 # | 2 # |
3 # Copyright 2017 The Chromium Authors. All rights reserved. | 3 # Copyright 2017 The Chromium Authors. All rights reserved. |
4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
6 | 6 |
7 import argparse | 7 import argparse |
8 import collections | 8 import collections |
9 import json | 9 import json |
10 import tempfile | 10 import tempfile |
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
241 if suite[FAIL_COUNT_INDEX]['data'] > 0: | 241 if suite[FAIL_COUNT_INDEX]['data'] > 0: |
242 suite[FAIL_COUNT_INDEX]['class'] += ' failure' | 242 suite[FAIL_COUNT_INDEX]['class'] += ' failure' |
243 else: | 243 else: |
244 suite[FAIL_COUNT_INDEX]['class'] += ' success' | 244 suite[FAIL_COUNT_INDEX]['class'] += ' success' |
245 | 245 |
246 if footer_row[FAIL_COUNT_INDEX]['data'] > 0: | 246 if footer_row[FAIL_COUNT_INDEX]['data'] > 0: |
247 footer_row[FAIL_COUNT_INDEX]['class'] += ' failure' | 247 footer_row[FAIL_COUNT_INDEX]['class'] += ' failure' |
248 else: | 248 else: |
249 footer_row[FAIL_COUNT_INDEX]['class'] += ' success' | 249 footer_row[FAIL_COUNT_INDEX]['class'] += ' success' |
250 | 250 |
251 # Return the suite table on descending order of number of failed test cases. | |
251 return (header_row, | 252 return (header_row, |
jbudorick
2017/05/11 23:07:57
I'm surprised that we're doing this here rather th
the real yoland
2017/05/11 23:30:20
Agree, I think this should be done on the front en
| |
252 [[suite_row] for suite_row in suite_row_dict.values()], | 253 sorted( |
254 [[suite_row] for suite_row in suite_row_dict.values()], | |
255 key=lambda suite_row: (-1 * | |
256 suite_row[0][FAIL_COUNT_INDEX]['data'])), | |
253 footer_row) | 257 footer_row) |
254 | 258 |
255 | 259 |
256 def feedback_url(result_details_link): | 260 def feedback_url(result_details_link): |
257 url_args = urllib.urlencode([ | 261 url_args = urllib.urlencode([ |
258 ('labels', 'Pri-2,Type-Bug,Restrict-View-Google'), | 262 ('labels', 'Pri-2,Type-Bug,Restrict-View-Google'), |
259 ('summary', 'Result Details Feedback:'), | 263 ('summary', 'Result Details Feedback:'), |
260 ('components', 'Test>Android'), | 264 ('components', 'Test>Android'), |
261 ('comment', 'Please check out: %s' % result_details_link)]) | 265 ('comment', 'Please check out: %s' % result_details_link)]) |
262 return 'https://bugs.chromium.org/p/chromium/issues/entry?%s' % url_args | 266 return 'https://bugs.chromium.org/p/chromium/issues/entry?%s' % url_args |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
414 with open(json_file) as original_json_file: | 418 with open(json_file) as original_json_file: |
415 json_object = json.load(original_json_file) | 419 json_object = json.load(original_json_file) |
416 json_object['links'] = {'result_details': result_details_link} | 420 json_object['links'] = {'result_details': result_details_link} |
417 with open(args.output_json, 'w') as f: | 421 with open(args.output_json, 'w') as f: |
418 json.dump(json_object, f) | 422 json.dump(json_object, f) |
419 else: | 423 else: |
420 print result_details_link | 424 print result_details_link |
421 | 425 |
422 if __name__ == '__main__': | 426 if __name__ == '__main__': |
423 sys.exit(main()) | 427 sys.exit(main()) |
OLD | NEW |