| OLD | NEW |
| 1 # Copyright (C) 2010 Google Inc. All rights reserved. | 1 # Copyright (C) 2010 Google Inc. All rights reserved. |
| 2 # Copyright (C) 2010 Gabor Rapcsanyi (rgabor@inf.u-szeged.hu), University of Sze
ged | 2 # Copyright (C) 2010 Gabor Rapcsanyi (rgabor@inf.u-szeged.hu), University of Sze
ged |
| 3 # | 3 # |
| 4 # Redistribution and use in source and binary forms, with or without | 4 # Redistribution and use in source and binary forms, with or without |
| 5 # modification, are permitted provided that the following conditions are | 5 # modification, are permitted provided that the following conditions are |
| 6 # met: | 6 # met: |
| 7 # | 7 # |
| 8 # * Redistributions of source code must retain the above copyright | 8 # * Redistributions of source code must retain the above copyright |
| 9 # notice, this list of conditions and the following disclaimer. | 9 # notice, this list of conditions and the following disclaimer. |
| 10 # * Redistributions in binary form must reproduce the above | 10 # * Redistributions in binary form must reproduce the above |
| (...skipping 507 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 518 if response.code == 200: | 518 if response.code == 200: |
| 519 _log.debug("JSON uploaded.") | 519 _log.debug("JSON uploaded.") |
| 520 else: | 520 else: |
| 521 _log.debug("JSON upload failed, %d: '%s'", response.code, re
sponse.read()) | 521 _log.debug("JSON upload failed, %d: '%s'", response.code, re
sponse.read()) |
| 522 else: | 522 else: |
| 523 _log.error("JSON upload failed; no response returned") | 523 _log.error("JSON upload failed; no response returned") |
| 524 except Exception as err: | 524 except Exception as err: |
| 525 _log.error("Upload failed: %s", err) | 525 _log.error("Upload failed: %s", err) |
| 526 | 526 |
| 527 def _copy_results_html_file(self, destination_path): | 527 def _copy_results_html_file(self, destination_path): |
| 528 base_dir = self._port.path_from_webkit_base('LayoutTests', 'fast', 'harn
ess') | 528 base_dir = self._port.path_from_blink_base('LayoutTests', 'fast', 'harne
ss') |
| 529 results_file = self._filesystem.join(base_dir, 'results.html') | 529 results_file = self._filesystem.join(base_dir, 'results.html') |
| 530 # Note that the results.html template file won't exist when we're using
a MockFileSystem during unit tests, | 530 # Note that the results.html template file won't exist when we're using
a MockFileSystem during unit tests, |
| 531 # so make sure it exists before we try to copy it. | 531 # so make sure it exists before we try to copy it. |
| 532 if self._filesystem.exists(results_file): | 532 if self._filesystem.exists(results_file): |
| 533 self._filesystem.copyfile(results_file, destination_path) | 533 self._filesystem.copyfile(results_file, destination_path) |
| 534 | 534 |
| 535 def _stats_trie(self, initial_results): | 535 def _stats_trie(self, initial_results): |
| 536 def _worker_number(worker_name): | 536 def _worker_number(worker_name): |
| 537 return int(worker_name.split('/')[1]) if worker_name else -1 | 537 return int(worker_name.split('/')[1]) if worker_name else -1 |
| 538 | 538 |
| 539 stats = {} | 539 stats = {} |
| 540 for result in initial_results.results_by_name.values(): | 540 for result in initial_results.results_by_name.values(): |
| 541 if result.type != test_expectations.SKIP: | 541 if result.type != test_expectations.SKIP: |
| 542 stats[result.test_name] = {'results': (_worker_number(result.wor
ker_name), result.test_number, result.pid, int( | 542 stats[result.test_name] = {'results': (_worker_number(result.wor
ker_name), result.test_number, result.pid, int( |
| 543 result.test_run_time * 1000), int(result.total_run_time * 10
00))} | 543 result.test_run_time * 1000), int(result.total_run_time * 10
00))} |
| 544 stats_trie = {} | 544 stats_trie = {} |
| 545 for name, value in stats.iteritems(): | 545 for name, value in stats.iteritems(): |
| 546 json_results_generator.add_path_to_trie(name, value, stats_trie) | 546 json_results_generator.add_path_to_trie(name, value, stats_trie) |
| 547 return stats_trie | 547 return stats_trie |
| OLD | NEW |