Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(38)

Side by Side Diff: Tools/Scripts/webkitpy/layout_tests/controllers/manager.py

Issue 454853002: Fixing UnboundLocalError: local variable 'timestamp' in manager.py (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 def _rename_results_folder(self): 154 def _rename_results_folder(self):
155 try: 155 try:
156 timestamp = time.strftime("%Y-%m-%d-%H-%M-%S", time.localtime(self._ filesystem.mtime(self._filesystem.join(self._results_directory, "results.html")) )) 156 timestamp = time.strftime("%Y-%m-%d-%H-%M-%S", time.localtime(self._ filesystem.mtime(self._filesystem.join(self._results_directory, "results.html")) ))
157 except OSError, e: 157 except OSError, e:
158 # It might be possible that results.html was not generated in previo us run, because the test 158 # It might be possible that results.html was not generated in previo us run, because the test
159 # run was interrupted even before testing started. In those cases, d on't archive the folder. 159 # run was interrupted even before testing started. In those cases, d on't archive the folder.
160 # Simply override the current folder contents with new results. 160 # Simply override the current folder contents with new results.
161 import errno 161 import errno
162 if e.errno == errno.EEXIST: 162 if e.errno == errno.EEXIST:
163 _log.warning("No results.html file found in previous run, skippi ng it.") 163 _log.warning("No results.html file found in previous run, skippi ng it.")
164 return None 164 return None
165 archived_name = ''.join((self._filesystem.basename(self._results_directo ry), "_", timestamp)) 165 archived_name = ''.join((self._filesystem.basename(self._results_directo ry), "_", timestamp))
166 archived_path = self._filesystem.join(self._filesystem.dirname(self._res ults_directory), archived_name) 166 archived_path = self._filesystem.join(self._filesystem.dirname(self._res ults_directory), archived_name)
167 self._filesystem.move(self._results_directory, archived_path) 167 self._filesystem.move(self._results_directory, archived_path)
168 168
169 def _set_up_run(self, test_names): 169 def _set_up_run(self, test_names):
170 self._printer.write_update("Checking build ...") 170 self._printer.write_update("Checking build ...")
171 if self._options.build: 171 if self._options.build:
172 exit_code = self._port.check_build(self.needs_servers(test_names), s elf._printer) 172 exit_code = self._port.check_build(self.needs_servers(test_names), s elf._printer)
173 if exit_code: 173 if exit_code:
174 _log.error("Build check failed") 174 _log.error("Build check failed")
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after
458 return int(worker_name.split('/')[1]) if worker_name else -1 458 return int(worker_name.split('/')[1]) if worker_name else -1
459 459
460 stats = {} 460 stats = {}
461 for result in initial_results.results_by_name.values(): 461 for result in initial_results.results_by_name.values():
462 if result.type != test_expectations.SKIP: 462 if result.type != test_expectations.SKIP:
463 stats[result.test_name] = {'results': (_worker_number(result.wor ker_name), result.test_number, result.pid, int(result.test_run_time * 1000), int (result.total_run_time * 1000))} 463 stats[result.test_name] = {'results': (_worker_number(result.wor ker_name), result.test_number, result.pid, int(result.test_run_time * 1000), int (result.total_run_time * 1000))}
464 stats_trie = {} 464 stats_trie = {}
465 for name, value in stats.iteritems(): 465 for name, value in stats.iteritems():
466 json_results_generator.add_path_to_trie(name, value, stats_trie) 466 json_results_generator.add_path_to_trie(name, value, stats_trie)
467 return stats_trie 467 return stats_trie
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698