| 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 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 285 return test_expectations.SLOW in self._expectations.model().get_expectat
ions(test_file) | 285 return test_expectations.SLOW in self._expectations.model().get_expectat
ions(test_file) |
| 286 | 286 |
| 287 def _needs_servers(self, test_names): | 287 def _needs_servers(self, test_names): |
| 288 return any(self._test_requires_lock(test_name) for test_name in test_nam
es) | 288 return any(self._test_requires_lock(test_name) for test_name in test_nam
es) |
| 289 | 289 |
| 290 def _rename_results_folder(self): | 290 def _rename_results_folder(self): |
| 291 try: | 291 try: |
| 292 timestamp = time.strftime( | 292 timestamp = time.strftime( |
| 293 "%Y-%m-%d-%H-%M-%S", time.localtime( | 293 "%Y-%m-%d-%H-%M-%S", time.localtime( |
| 294 self._filesystem.mtime(self._filesystem.join(self._results_d
irectory, "results.html")))) | 294 self._filesystem.mtime(self._filesystem.join(self._results_d
irectory, "results.html")))) |
| 295 except (IOError, OSError) as e: | 295 except (IOError, OSError) as error: |
| 296 # It might be possible that results.html was not generated in previo
us run, because the test | 296 # It might be possible that results.html was not generated in previo
us run, because the test |
| 297 # run was interrupted even before testing started. In those cases, d
on't archive the folder. | 297 # run was interrupted even before testing started. In those cases, d
on't archive the folder. |
| 298 # Simply override the current folder contents with new results. | 298 # Simply override the current folder contents with new results. |
| 299 import errno | 299 import errno |
| 300 if e.errno == errno.EEXIST or e.errno == errno.ENOENT: | 300 if error.errno in (errno.EEXIST, errno.ENOENT): |
| 301 self._printer.write_update("No results.html file found in previo
us run, skipping it.") | 301 self._printer.write_update("No results.html file found in previo
us run, skipping it.") |
| 302 return None | 302 return None |
| 303 archived_name = ''.join((self._filesystem.basename(self._results_directo
ry), "_", timestamp)) | 303 archived_name = ''.join((self._filesystem.basename(self._results_directo
ry), "_", timestamp)) |
| 304 archived_path = self._filesystem.join(self._filesystem.dirname(self._res
ults_directory), archived_name) | 304 archived_path = self._filesystem.join(self._filesystem.dirname(self._res
ults_directory), archived_name) |
| 305 self._filesystem.move(self._results_directory, archived_path) | 305 self._filesystem.move(self._results_directory, archived_path) |
| 306 | 306 |
| 307 def _delete_dirs(self, dir_list): | 307 def _delete_dirs(self, dir_list): |
| 308 for dir in dir_list: | 308 for dir in dir_list: |
| 309 self._filesystem.rmtree(dir) | 309 self._filesystem.rmtree(dir) |
| 310 | 310 |
| (...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 |