| 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 | |
| 8 from model.base_build_model import BaseBuildModel | 7 from model.base_build_model import BaseBuildModel |
| 9 from model.base_analysis import BaseAnalysis | 8 from model.base_analysis import BaseAnalysis |
| 10 from model.flake.flake_swarming_task import FlakeSwarmingTask | 9 from model.flake.flake_swarming_task import FlakeSwarmingTask |
| 11 | 10 |
| 11 |
| 12 class MasterFlakeAnalysis(BaseAnalysis, BaseBuildModel): | 12 class MasterFlakeAnalysis(BaseAnalysis, BaseBuildModel): |
| 13 """Represents an analysis of a flaky test in a Chromium Waterfall.""" | 13 """Represents an analysis of a flaky test in a Chromium Waterfall.""" |
| 14 |
| 14 @staticmethod | 15 @staticmethod |
| 15 def CreateAnalysisId(master_name, builder_name, | 16 def CreateAnalysisId(master_name, builder_name, |
| 16 build_number, step_name, test_name): | 17 build_number, step_name, test_name): |
| 17 return '%s/%s/%s/%s/%s' % (master_name, builder_name, | 18 return '%s/%s/%s/%s/%s' % (master_name, builder_name, |
| 18 build_number, step_name, test_name) | 19 build_number, step_name, test_name) |
| 19 | 20 |
| 20 @ndb.ComputedProperty | 21 @ndb.ComputedProperty |
| 21 def step_name(self): | 22 def step_name(self): |
| 22 return self.key.pairs()[0][1].split('/')[3] | 23 return self.key.pairs()[0][1].split('/')[3] |
| 23 | 24 |
| (...skipping 22 matching lines...) Expand all Loading... |
| 46 step_name, test_name): # pragma: no cover | 47 step_name, test_name): # pragma: no cover |
| 47 return MasterFlakeAnalysis._CreateKey( | 48 return MasterFlakeAnalysis._CreateKey( |
| 48 master_name, builder_name, build_number, step_name, test_name).get() | 49 master_name, builder_name, build_number, step_name, test_name).get() |
| 49 | 50 |
| 50 # List of tested build_numbers and their corresponding success rates. | 51 # List of tested build_numbers and their corresponding success rates. |
| 51 # We need to keep these sorted manually. | 52 # We need to keep these sorted manually. |
| 52 build_numbers = ndb.IntegerProperty(indexed=True, repeated=True) | 53 build_numbers = ndb.IntegerProperty(indexed=True, repeated=True) |
| 53 success_rates = ndb.FloatProperty(indexed=False, repeated=True) | 54 success_rates = ndb.FloatProperty(indexed=False, repeated=True) |
| 54 flake_swarming_tasks = ndb.KeyProperty( | 55 flake_swarming_tasks = ndb.KeyProperty( |
| 55 kind='FlakeSwarmingTask', repeated=True) | 56 kind='FlakeSwarmingTask', repeated=True) |
| 57 suspected_flake_build_number = ndb.IntegerProperty() |
| OLD | NEW |