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

Side by Side Diff: appengine/findit/model/flake/master_flake_analysis.py

Issue 2510223003: [Findit] Fixing analysis mismatch in check flake (Closed)
Patch Set: rebase Created 4 years, 1 month 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 base64 5 import base64
6 6
7 from google.appengine.ext import ndb 7 from google.appengine.ext import ndb
8 8
9 from gae_libs.model.versioned_model import VersionedModel 9 from gae_libs.model.versioned_model import VersionedModel
10 from model import result_status 10 from model import result_status
11 from model import triage_status 11 from model import triage_status
12 from model.base_analysis import BaseAnalysis 12 from model.base_analysis import BaseAnalysis
13 from model.base_build_model import BaseBuildModel 13 from model.base_build_model import BaseBuildModel
14 from model.base_triaged_model import TriagedModel
14 from model.flake.flake_swarming_task import FlakeSwarmingTaskData 15 from model.flake.flake_swarming_task import FlakeSwarmingTaskData
15 from model.base_triaged_model import TriagedModel
16 16
17 17
18 class DataPoint(ndb.Model): 18 class DataPoint(ndb.Model):
19 build_number = ndb.IntegerProperty(indexed=False) 19 build_number = ndb.IntegerProperty(indexed=False)
20 pass_rate = ndb.FloatProperty(indexed=False) 20 pass_rate = ndb.FloatProperty(indexed=False)
21 21
22 22
23 class MasterFlakeAnalysis( 23 class MasterFlakeAnalysis(
24 BaseAnalysis, BaseBuildModel, VersionedModel, TriagedModel): 24 BaseAnalysis, BaseBuildModel, VersionedModel, TriagedModel):
25 """Represents an analysis of a flaky test on a Waterfall test cycle.""" 25 """Represents an analysis of a flaky test on a Waterfall test cycle."""
(...skipping 18 matching lines...) Expand all
44 return -1 44 return -1
45 return self.algorithm_parameters.get('iterations_to_rerun') 45 return self.algorithm_parameters.get('iterations_to_rerun')
46 46
47 @staticmethod 47 @staticmethod
48 def _CreateAnalysisId( 48 def _CreateAnalysisId(
49 master_name, builder_name, build_number, step_name, test_name): 49 master_name, builder_name, build_number, step_name, test_name):
50 encoded_test_name = base64.urlsafe_b64encode(test_name) 50 encoded_test_name = base64.urlsafe_b64encode(test_name)
51 return '%s/%s/%s/%s/%s' % ( 51 return '%s/%s/%s/%s/%s' % (
52 master_name, builder_name, build_number, step_name, encoded_test_name) 52 master_name, builder_name, build_number, step_name, encoded_test_name)
53 53
54 @staticmethod
55 def GetBuildConfigurationFromKey(master_flake_analysis_key):
56 """Extracts master_name and builder_name from key."""
57 if not master_flake_analysis_key:
58 return None, None
59
60 components = master_flake_analysis_key.pairs()[0][1].split('/')
61 master_name = components[0]
62 builder_name = components[1]
63 return master_name, builder_name
64
54 # Arguments number differs from overridden method - pylint: disable=W0221 65 # Arguments number differs from overridden method - pylint: disable=W0221
55 @classmethod 66 @classmethod
56 def Create(cls, master_name, builder_name, build_number, step_name, 67 def Create(cls, master_name, builder_name, build_number, step_name,
57 test_name): # pragma: no cover. 68 test_name): # pragma: no cover.
58 return super(MasterFlakeAnalysis, cls).Create( 69 return super(MasterFlakeAnalysis, cls).Create(
59 MasterFlakeAnalysis._CreateAnalysisId( 70 MasterFlakeAnalysis._CreateAnalysisId(
60 master_name, builder_name, build_number, step_name, test_name)) 71 master_name, builder_name, build_number, step_name, test_name))
61 72
62 # Arguments number differs from overridden method - pylint: disable=W0221 73 # Arguments number differs from overridden method - pylint: disable=W0221
63 @classmethod 74 @classmethod
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 # Findit's automatic analysis upon detection, or Findit API. 160 # Findit's automatic analysis upon detection, or Findit API.
150 triggering_source = ndb.IntegerProperty(default=None, indexed=True) 161 triggering_source = ndb.IntegerProperty(default=None, indexed=True)
151 162
152 # Who triggered the analysis. Used for differentiating between manual and 163 # Who triggered the analysis. Used for differentiating between manual and
153 # automatic runs, and determining the most active users to gather feedback. 164 # automatic runs, and determining the most active users to gather feedback.
154 triggering_user_email = ndb.StringProperty(default=None, indexed=False) 165 triggering_user_email = ndb.StringProperty(default=None, indexed=False)
155 166
156 # Overall conclusion of analysis result for the flake. Found untriaged, Found 167 # Overall conclusion of analysis result for the flake. Found untriaged, Found
157 # Correct, etc. used to filter what is displayed on the check flake dashboard. 168 # Correct, etc. used to filter what is displayed on the check flake dashboard.
158 result_status = ndb.IntegerProperty(indexed=True) 169 result_status = ndb.IntegerProperty(indexed=True)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698