| 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 import base64 | 5 import base64 |
| 6 | 6 |
| 7 from google.appengine.ext import ndb | 7 from google.appengine.ext import ndb |
| 8 | 8 |
| 9 from model import analysis_status | 9 from model import analysis_status |
| 10 from model.base_analysis import BaseAnalysis | 10 from model.base_analysis import BaseAnalysis |
| 11 from model.base_build_model import BaseBuildModel | 11 from model.base_build_model import BaseBuildModel |
| 12 from model.flake.flake_swarming_task import FlakeSwarmingTaskData | 12 from model.flake.flake_swarming_task import FlakeSwarmingTaskData |
| 13 from model.versioned_model import VersionedModel | 13 from model.versioned_model import VersionedModel |
| 14 from model.base_triaged_model import TriagedModel |
| 14 | 15 |
| 15 | 16 |
| 16 class DataPoint(ndb.Model): | 17 class DataPoint(ndb.Model): |
| 17 build_number = ndb.IntegerProperty(indexed=False) | 18 build_number = ndb.IntegerProperty(indexed=False) |
| 18 pass_rate = ndb.FloatProperty(indexed=False) | 19 pass_rate = ndb.FloatProperty(indexed=False) |
| 19 | 20 |
| 20 | 21 |
| 21 class MasterFlakeAnalysis(BaseAnalysis, BaseBuildModel, VersionedModel): | 22 class MasterFlakeAnalysis( |
| 23 BaseAnalysis, BaseBuildModel, VersionedModel, TriagedModel): |
| 22 """Represents an analysis of a flaky test on a Waterfall test cycle.""" | 24 """Represents an analysis of a flaky test on a Waterfall test cycle.""" |
| 23 | 25 |
| 24 @ndb.ComputedProperty | 26 @ndb.ComputedProperty |
| 25 def step_name(self): | 27 def step_name(self): |
| 26 return self.key.pairs()[0][1].split('/')[3] | 28 return self.key.pairs()[0][1].split('/')[3] |
| 27 | 29 |
| 28 @ndb.ComputedProperty | 30 @ndb.ComputedProperty |
| 29 def test_name(self): | 31 def test_name(self): |
| 30 return base64.urlsafe_b64decode(self.key.pairs()[0][1].split('/')[4]) | 32 return base64.urlsafe_b64decode(self.key.pairs()[0][1].split('/')[4]) |
| 31 | 33 |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 # 'upper_flake_threshold': 0.98 | 107 # 'upper_flake_threshold': 0.98 |
| 106 # } | 108 # } |
| 107 algorithm_parameters = ndb.JsonProperty(indexed=False) | 109 algorithm_parameters = ndb.JsonProperty(indexed=False) |
| 108 | 110 |
| 109 # The suspected build number to have introduced the flakiness. | 111 # The suspected build number to have introduced the flakiness. |
| 110 suspected_flake_build_number = ndb.IntegerProperty() | 112 suspected_flake_build_number = ndb.IntegerProperty() |
| 111 | 113 |
| 112 # The data points used to plot the flakiness graph build over build. | 114 # The data points used to plot the flakiness graph build over build. |
| 113 data_points = ndb.LocalStructuredProperty( | 115 data_points = ndb.LocalStructuredProperty( |
| 114 DataPoint, repeated=True, compressed=True) | 116 DataPoint, repeated=True, compressed=True) |
| OLD | NEW |