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

Side by Side Diff: dashboard/dashboard/pinpoint/models/quest/execution.py

Issue 3001163002: Pinpoint - Surface info from executions for display in UI. (Closed)
Patch Set: Rebase again. Created 3 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
OLDNEW
1 # Copyright 2016 The Chromium Authors. All rights reserved. 1 # Copyright 2016 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 import traceback 5 import traceback
6 6
7 7
8 class Execution(object): 8 class Execution(object):
9 """Object tracking the execution of a Quest. 9 """Object tracking the execution of a Quest.
10 10
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 @property 58 @property
59 def result_arguments(self): 59 def result_arguments(self):
60 """A dict of information passed on to the next Execution. 60 """A dict of information passed on to the next Execution.
61 61
62 For example, the Build Execution passes the isolate hash to the Test 62 For example, the Build Execution passes the isolate hash to the Test
63 Execution. 63 Execution.
64 """ 64 """
65 assert self.completed 65 assert self.completed
66 return self._result_arguments 66 return self._result_arguments
67 67
68 def AsDict(self):
69 d = {
70 'result_arguments': self.result_arguments if self.completed else {},
71 'result_values': self.result_values if self.completed else None,
72 }
73 d.update(self._AsDict())
74 return d
75
76 def _AsDict(self):
77 raise NotImplementedError()
78
68 def Poll(self): 79 def Poll(self):
69 """Update the Execution status.""" 80 """Update the Execution status."""
70 assert not self.completed 81 assert not self.completed
71 82
72 try: 83 try:
73 self._Poll() 84 self._Poll()
74 except StandardError: 85 except StandardError:
75 # StandardError most likely indicates a bug in the code. 86 # StandardError most likely indicates a bug in the code.
76 # We should fail fast to aid debugging. 87 # We should fail fast to aid debugging.
77 raise 88 raise
78 except Exception: # pylint: disable=broad-except 89 except Exception: # pylint: disable=broad-except
79 # We allow broad exception handling here, because we log the exception and 90 # We allow broad exception handling here, because we log the exception and
80 # display it in the UI. 91 # display it in the UI.
81 self._completed = True 92 self._completed = True
82 self._failed = True 93 self._failed = True
83 self._result_values = (traceback.format_exc(),) 94 self._result_values = (traceback.format_exc(),)
84 95
85 96
86 def _Poll(self): 97 def _Poll(self):
87 raise NotImplementedError() 98 raise NotImplementedError()
88 99
89 def _Complete(self, result_values=None, result_arguments=None): 100 def _Complete(self, result_values=None, result_arguments=None):
90 self._completed = True 101 self._completed = True
91 self._failed = False 102 self._failed = False
92 self._result_values = result_values or (None,) 103 self._result_values = result_values or (None,)
93 self._result_arguments = result_arguments or {} 104 self._result_arguments = result_arguments or {}
OLDNEW
« no previous file with comments | « dashboard/dashboard/pinpoint/models/job.py ('k') | dashboard/dashboard/pinpoint/models/quest/find_isolate.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698