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

Side by Side Diff: appengine/findit/model/wf_swarming_task.py

Issue 2027333002: [Findit] don't included skipped or unknown tests in swarming tasks into failed tests. (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: . Created 4 years, 6 months 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 from collections import defaultdict 5 from collections import defaultdict
6 6
7 from google.appengine.ext import ndb 7 from google.appengine.ext import ndb
8 8
9 from model.base_build_model import BaseBuildModel 9 from model.base_build_model import BaseBuildModel
10 from model import analysis_status 10 from model import analysis_status
(...skipping 28 matching lines...) Expand all
39 # parameters need to be stored and analyzed later. 39 # parameters need to be stored and analyzed later.
40 parameters = ndb.JsonProperty(default={}, indexed=False, compressed=True) 40 parameters = ndb.JsonProperty(default={}, indexed=False, compressed=True)
41 41
42 @property 42 @property
43 def classified_tests(self): 43 def classified_tests(self):
44 """Classification of tests into lists of reliable and flaky tests. 44 """Classification of tests into lists of reliable and flaky tests.
45 45
46 example format would be: 46 example format would be:
47 { 47 {
48 'flaky_tests': ['test1', 'test2', ...], 48 'flaky_tests': ['test1', 'test2', ...],
49 'reliable_tests': ['test3', ...] 49 'reliable_tests': ['test3', ...],
50 'unknown_tests': ['test4', ...]
50 } 51 }
51 """ 52 """
52 classified_tests = defaultdict(list) 53 classified_tests = defaultdict(list)
53 for test_name, test_statuses in self.tests_statuses.iteritems(): 54 for test_name, test_statuses in self.tests_statuses.iteritems():
54 if test_statuses.get('SUCCESS'): # Test passed for some runs, flaky. 55 if test_statuses.get('SUCCESS'): # Test passed for some runs, flaky.
55 classified_tests['flaky_tests'].append(test_name) 56 classified_tests['flaky_tests'].append(test_name)
57 elif test_statuses.get('UNKNOWN'):
58 classified_tests['unknown_tests'].append(test_name)
56 else: 59 else:
57 # Here we consider a 'non-flaky' test to be 'reliable'. 60 # Here we consider a 'non-flaky' test to be 'reliable'.
61 # If the test is 'SKIPPED', there should be failure in its dependency,
62 # consider it to be failed as well.
58 # TODO(chanli): Check more test statuses. 63 # TODO(chanli): Check more test statuses.
59 classified_tests['reliable_tests'].append(test_name) 64 classified_tests['reliable_tests'].append(test_name)
60 return classified_tests 65 return classified_tests
61 66
62 @staticmethod 67 @staticmethod
63 def _CreateKey( 68 def _CreateKey(
64 master_name, builder_name, build_number, step_name): # pragma: no cover 69 master_name, builder_name, build_number, step_name): # pragma: no cover
65 build_id = BaseBuildModel.CreateBuildId( 70 build_id = BaseBuildModel.CreateBuildId(
66 master_name, builder_name, build_number) 71 master_name, builder_name, build_number)
67 return ndb.Key('WfBuild', build_id, 'WfSwarmingTask', step_name) 72 return ndb.Key('WfBuild', build_id, 'WfSwarmingTask', step_name)
68 73
69 @staticmethod 74 @staticmethod
70 def Create( 75 def Create(
71 master_name, builder_name, build_number, step_name): # pragma: no cover 76 master_name, builder_name, build_number, step_name): # pragma: no cover
72 return WfSwarmingTask( 77 return WfSwarmingTask(
73 key=WfSwarmingTask._CreateKey( 78 key=WfSwarmingTask._CreateKey(
74 master_name, builder_name, build_number, step_name)) 79 master_name, builder_name, build_number, step_name))
75 80
76 @staticmethod 81 @staticmethod
77 def Get( 82 def Get(
78 master_name, builder_name, build_number, step_name): # pragma: no cover 83 master_name, builder_name, build_number, step_name): # pragma: no cover
79 return WfSwarmingTask._CreateKey( 84 return WfSwarmingTask._CreateKey(
80 master_name, builder_name, build_number, step_name).get() 85 master_name, builder_name, build_number, step_name).get()
OLDNEW
« no previous file with comments | « appengine/findit/model/test/wf_swarming_task_test.py ('k') | appengine/findit/waterfall/detect_first_failure_pipeline.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698