OLD | NEW |
1 # Copyright (C) 2010 Google Inc. All rights reserved. | 1 # Copyright (C) 2010 Google Inc. All rights reserved. |
2 # | 2 # |
3 # Redistribution and use in source and binary forms, with or without | 3 # Redistribution and use in source and binary forms, with or without |
4 # modification, are permitted provided that the following conditions are | 4 # modification, are permitted provided that the following conditions are |
5 # met: | 5 # met: |
6 # | 6 # |
7 # * Redistributions of source code must retain the above copyright | 7 # * Redistributions of source code must retain the above copyright |
8 # notice, this list of conditions and the following disclaimer. | 8 # notice, this list of conditions and the following disclaimer. |
9 # * Redistributions in binary form must reproduce the above | 9 # * Redistributions in binary form must reproduce the above |
10 # copyright notice, this list of conditions and the following disclaimer | 10 # copyright notice, this list of conditions and the following disclaimer |
(...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
360 return | 360 return |
361 | 361 |
362 for key in full_results: | 362 for key in full_results: |
363 new_results[key] = {} | 363 new_results[key] = {} |
364 cls._populate_tests_from_full_results(full_results[key], new_results
[key]) | 364 cls._populate_tests_from_full_results(full_results[key], new_results
[key]) |
365 | 365 |
366 @classmethod | 366 @classmethod |
367 def _convert_full_results_format_to_aggregate(cls, full_results_format): | 367 def _convert_full_results_format_to_aggregate(cls, full_results_format): |
368 num_total_tests = 0 | 368 num_total_tests = 0 |
369 num_failing_tests = 0 | 369 num_failing_tests = 0 |
370 fixableCounts = {} | |
371 failures_by_type = full_results_format[FAILURES_BY_TYPE_KEY] | 370 failures_by_type = full_results_format[FAILURES_BY_TYPE_KEY] |
372 | 371 |
373 # FIXME: full_results format has "FAIL" entries, but that is no longer a
possible result type. | 372 # FIXME: full_results format has "FAIL" entries, but that is no longer a
possible result type. |
374 if 'FAIL' in failures_by_type: | 373 if 'FAIL' in failures_by_type: |
375 del failures_by_type['FAIL'] | 374 del failures_by_type['FAIL'] |
376 | 375 |
377 for failure_type in failures_by_type: | |
378 count = failures_by_type[failure_type] | |
379 num_total_tests += count | |
380 if failure_type != PASS_STRING: | |
381 num_failing_tests += count | |
382 fixableCounts[FAILURE_TO_CHAR[failure_type]] = count | |
383 | |
384 tests = {} | 376 tests = {} |
385 cls._populate_tests_from_full_results(full_results_format[TESTS_KEY], te
sts) | 377 cls._populate_tests_from_full_results(full_results_format[TESTS_KEY], te
sts) |
386 | 378 |
387 aggregate_results_format = { | 379 aggregate_results_format = { |
388 VERSIONS_KEY: JSON_RESULTS_HIERARCHICAL_VERSION, | 380 VERSIONS_KEY: JSON_RESULTS_HIERARCHICAL_VERSION, |
389 full_results_format['builder_name']: { | 381 full_results_format['builder_name']: { |
390 # FIXME: Use dict comprehensions once we update the server to py
thon 2.7. | 382 # FIXME: Use dict comprehensions once we update the server to py
thon 2.7. |
391 FAILURES_BY_TYPE_KEY: dict((key, [value]) for key, value in fail
ures_by_type.items()), | 383 FAILURES_BY_TYPE_KEY: dict((key, [value]) for key, value in fail
ures_by_type.items()), |
392 TESTS_KEY: tests, | 384 TESTS_KEY: tests, |
393 # FIXME: Have all the consumers of this switch over to the full_
results_format keys | 385 # FIXME: Have all the consumers of this switch over to the full_
results_format keys |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
520 | 512 |
521 check_json_error_string = cls._check_json(builder, json) | 513 check_json_error_string = cls._check_json(builder, json) |
522 if check_json_error_string: | 514 if check_json_error_string: |
523 return None | 515 return None |
524 | 516 |
525 test_list_json = {} | 517 test_list_json = {} |
526 tests = json[builder][TESTS_KEY] | 518 tests = json[builder][TESTS_KEY] |
527 cls._delete_results_and_times(tests) | 519 cls._delete_results_and_times(tests) |
528 test_list_json[builder] = {TESTS_KEY: tests} | 520 test_list_json[builder] = {TESTS_KEY: tests} |
529 return cls._generate_file_data(test_list_json) | 521 return cls._generate_file_data(test_list_json) |
OLD | NEW |