| 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 519 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 530 if response.code == 200: | 530 if response.code == 200: |
| 531 _log.debug("JSON uploaded.") | 531 _log.debug("JSON uploaded.") |
| 532 else: | 532 else: |
| 533 _log.debug("JSON upload failed, %d: '%s'", response.code, re
sponse.read()) | 533 _log.debug("JSON upload failed, %d: '%s'", response.code, re
sponse.read()) |
| 534 else: | 534 else: |
| 535 _log.error("JSON upload failed; no response returned") | 535 _log.error("JSON upload failed; no response returned") |
| 536 except Exception as err: | 536 except Exception as err: |
| 537 _log.error("Upload failed: %s", err) | 537 _log.error("Upload failed: %s", err) |
| 538 | 538 |
| 539 def _copy_results_html_file(self, destination_path): | 539 def _copy_results_html_file(self, destination_path): |
| 540 base_dir = self._port.path_from_webkit_base('LayoutTests', 'fast', 'harn
ess') | 540 base_dir = self._webkit_finder.path_from_layout_tests('fast', 'harness') |
| 541 results_file = self._filesystem.join(base_dir, 'results.html') | 541 results_file = self._filesystem.join(base_dir, 'results.html') |
| 542 # Note that the results.html template file won't exist when we're using
a MockFileSystem during unit tests, | 542 # Note that the results.html template file won't exist when we're using
a MockFileSystem during unit tests, |
| 543 # so make sure it exists before we try to copy it. | 543 # so make sure it exists before we try to copy it. |
| 544 if self._filesystem.exists(results_file): | 544 if self._filesystem.exists(results_file): |
| 545 self._filesystem.copyfile(results_file, destination_path) | 545 self._filesystem.copyfile(results_file, destination_path) |
| 546 | 546 |
| 547 def _stats_trie(self, initial_results): | 547 def _stats_trie(self, initial_results): |
| 548 def _worker_number(worker_name): | 548 def _worker_number(worker_name): |
| 549 return int(worker_name.split('/')[1]) if worker_name else -1 | 549 return int(worker_name.split('/')[1]) if worker_name else -1 |
| 550 | 550 |
| 551 stats = {} | 551 stats = {} |
| 552 for result in initial_results.results_by_name.values(): | 552 for result in initial_results.results_by_name.values(): |
| 553 if result.type != test_expectations.SKIP: | 553 if result.type != test_expectations.SKIP: |
| 554 stats[result.test_name] = {'results': (_worker_number(result.wor
ker_name), result.test_number, result.pid, int( | 554 stats[result.test_name] = {'results': (_worker_number(result.wor
ker_name), result.test_number, result.pid, int( |
| 555 result.test_run_time * 1000), int(result.total_run_time * 10
00))} | 555 result.test_run_time * 1000), int(result.total_run_time * 10
00))} |
| 556 stats_trie = {} | 556 stats_trie = {} |
| 557 for name, value in stats.iteritems(): | 557 for name, value in stats.iteritems(): |
| 558 json_results_generator.add_path_to_trie(name, value, stats_trie) | 558 json_results_generator.add_path_to_trie(name, value, stats_trie) |
| 559 return stats_trie | 559 return stats_trie |
| OLD | NEW |