| OLD | NEW |
| 1 # Copyright 2015 The Chromium Authors. All rights reserved. | 1 # Copyright 2015 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 from google.appengine.ext import ndb | 5 from google.appengine.ext import ndb |
| 6 | 6 |
| 7 from model.base_build_model import BaseBuildModel | 7 from model.base_build_model import BaseBuildModel |
| 8 from model import wf_analysis_status | 8 from model import wf_analysis_status |
| 9 | 9 |
| 10 | 10 |
| 11 class WfTryJob(BaseBuildModel): | 11 class WfTryJob(BaseBuildModel): |
| 12 """Represents a try job results for a failed build. | 12 """Represents a try job results for a failed build. |
| 13 | 13 |
| 14 'Wf' is short for waterfall. | 14 'Wf' is short for waterfall. |
| 15 """ | 15 """ |
| 16 # A list of dict containing results and urls of each try job for compile. | 16 # A list of dict containing results and urls of each try job for compile. |
| 17 compile_results = ndb.JsonProperty(default=[], indexed=False, compressed=True) | 17 compile_results = ndb.JsonProperty(default=[], indexed=False, compressed=True) |
| 18 # TODO(chanli): Add test_results when add support for try jobs for test. | 18 |
| 19 # A list of dict containing results and urls of each try job for test. |
| 20 test_results = ndb.JsonProperty(default=[], indexed=False, compressed=True) |
| 19 | 21 |
| 20 # The status of the try job. | 22 # The status of the try job. |
| 21 status = ndb.IntegerProperty( | 23 status = ndb.IntegerProperty( |
| 22 default=wf_analysis_status.PENDING, indexed=False) | 24 default=wf_analysis_status.PENDING, indexed=False) |
| 23 | 25 |
| 24 # A list of try job IDs associated with each try job for collecting metadata. | 26 # A list of try job IDs associated with each try job for collecting metadata. |
| 25 try_job_ids = ndb.JsonProperty(default=[], indexed=False, compressed=True) | 27 try_job_ids = ndb.JsonProperty(default=[], indexed=False, compressed=True) |
| 26 | 28 |
| 27 @staticmethod | 29 @staticmethod |
| 28 def _CreateKey(master_name, builder_name, build_number): # pragma: no cover | 30 def _CreateKey(master_name, builder_name, build_number): # pragma: no cover |
| (...skipping 12 matching lines...) Expand all Loading... |
| 41 master_name, builder_name, build_number).get() | 43 master_name, builder_name, build_number).get() |
| 42 | 44 |
| 43 @property | 45 @property |
| 44 def completed(self): | 46 def completed(self): |
| 45 return self.status in ( | 47 return self.status in ( |
| 46 wf_analysis_status.ANALYZED, wf_analysis_status.ERROR) | 48 wf_analysis_status.ANALYZED, wf_analysis_status.ERROR) |
| 47 | 49 |
| 48 @property | 50 @property |
| 49 def failed(self): | 51 def failed(self): |
| 50 return self.status == wf_analysis_status.ERROR | 52 return self.status == wf_analysis_status.ERROR |
| OLD | NEW |