| OLD | NEW |
| 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 from google.appengine.ext import ndb | 5 from google.appengine.ext import ndb |
| 6 | 6 |
| 7 from model import analysis_status | 7 from model import analysis_status |
| 8 | 8 |
| 9 | 9 |
| 10 class BaseSwarmingTask(ndb.Model): | 10 class BaseSwarmingTask(ndb.Model): |
| 11 """Represents the progress of a general swarming task.""" | 11 """Represents the progress of a general swarming task.""" |
| 12 # The id of the Swarming task scheduled or running on Swarming Server. | 12 # The id of the Swarming task scheduled or running on Swarming Server. |
| 13 task_id = ndb.StringProperty(indexed=True) | 13 task_id = ndb.StringProperty(indexed=True) |
| 14 | 14 |
| 15 # A dict to keep track of running information for each test: | 15 # A dict to keep track of running information for each test: |
| 16 # number of total runs, number of each status (such as 'SUCCESS' or 'FAILED') | 16 # number of total runs, number of each status (such as 'SUCCESS' or 'FAILED') |
| 17 tests_statuses = ndb.JsonProperty(indexed=False, compressed=True) | 17 tests_statuses = ndb.JsonProperty(indexed=False, compressed=True) |
| 18 | 18 |
| 19 # The status of the swarming task. | 19 # The status of the swarming task. |
| 20 status = ndb.IntegerProperty( | 20 status = ndb.IntegerProperty(default=analysis_status.PENDING, indexed=False) |
| 21 default=analysis_status.PENDING, indexed=False) | |
| 22 | 21 |
| 23 # An error dict containing an error code and message should this task fail | 22 # An error dict containing an error code and message should this task fail |
| 24 # unexpectedly. For example: | 23 # unexpectedly. For example: |
| 25 # { | 24 # { |
| 26 # 'code': 1, | 25 # 'code': 1, |
| 27 # 'message': 'Timed out' | 26 # 'message': 'Timed out' |
| 28 # } | 27 # } |
| 29 error = ndb.JsonProperty(indexed=False) | 28 error = ndb.JsonProperty(indexed=False) |
| 30 | 29 |
| 31 # The revision of the failed build. | 30 # The revision of the failed build. |
| 32 build_revision = ndb.StringProperty(indexed=False) | 31 build_revision = ndb.StringProperty(indexed=False) |
| 33 | 32 |
| 34 # Time when the task is created. | 33 # Time when the task is created. |
| 35 created_time = ndb.DateTimeProperty(indexed=True) | 34 created_time = ndb.DateTimeProperty(indexed=True) |
| 36 # Time when the task is started. | 35 # Time when the task is started. |
| 37 started_time = ndb.DateTimeProperty(indexed=False) | 36 started_time = ndb.DateTimeProperty(indexed=False) |
| 38 # Time when the task is completed. | 37 # Time when the task is completed. |
| 39 completed_time = ndb.DateTimeProperty(indexed=False) | 38 completed_time = ndb.DateTimeProperty(indexed=False) |
| 40 | 39 |
| 41 # parameters need to be stored and analyzed later. | 40 # parameters need to be stored and analyzed later. |
| 42 parameters = ndb.JsonProperty(default={}, indexed=False, compressed=True) | 41 parameters = ndb.JsonProperty(default={}, indexed=False, compressed=True) |
| OLD | NEW |