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

Side by Side Diff: appengine/findit/waterfall/test/try_job_util_test.py

Issue 1898003002: [Findit] Fixing when try job entities are created (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: Addressing comments Created 4 years, 8 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
« no previous file with comments | « no previous file | appengine/findit/waterfall/try_job_util.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2015 The Chromium Authors. All rights reserved. 1 # Copyright 2015 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 common.waterfall import failure_type
5 from model import analysis_status 6 from model import analysis_status
6 from model.wf_try_job import WfTryJob 7 from model.wf_try_job import WfTryJob
7 from waterfall import try_job_util 8 from waterfall import try_job_util
8 from waterfall.test import wf_testcase 9 from waterfall.test import wf_testcase
9 from waterfall.try_job_type import TryJobType 10 from waterfall.try_job_type import TryJobType
10 11
11 12
12 class _MockRootPipeline(object): 13 class _MockRootPipeline(object):
13 STARTED = False 14 STARTED = False
14 15
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 master_name = 'master2' 76 master_name = 'master2'
76 builder_name = 'builder2' 77 builder_name = 'builder2'
77 build_number = 223 78 build_number = 223
78 failure_info = { 79 failure_info = {
79 'master_name': master_name, 80 'master_name': master_name,
80 'builder_name': builder_name, 81 'builder_name': builder_name,
81 'build_number': build_number, 82 'build_number': build_number,
82 'failed_steps': { 83 'failed_steps': {
83 'a_test': {} 84 'a_test': {}
84 }, 85 },
86 'failure_type': failure_type.TEST
85 } 87 }
86 88
87 failure_result_map = try_job_util.ScheduleTryJobIfNeeded( 89 failure_result_map = try_job_util.ScheduleTryJobIfNeeded(
88 failure_info, None, None) 90 failure_info, None, None)
89 91
90 self.assertEqual({}, failure_result_map) 92 self.assertEqual({}, failure_result_map)
91 93
92 def testNotNeedANewTryJobIfNotFirstTimeFailure(self): 94 def testNotNeedANewTryJobIfNotFirstTimeFailure(self):
93 master_name = 'm' 95 master_name = 'm'
94 builder_name = 'b' 96 builder_name = 'b'
(...skipping 19 matching lines...) Expand all
114 'chromium_revision': '221-2' 116 'chromium_revision': '221-2'
115 }, 117 },
116 '222': { 118 '222': {
117 'blame_list': ['222-1'], 119 'blame_list': ['222-1'],
118 'chromium_revision': '222-1' 120 'chromium_revision': '222-1'
119 }, 121 },
120 '223': { 122 '223': {
121 'blame_list': ['223-1', '223-2', '223-3'], 123 'blame_list': ['223-1', '223-2', '223-3'],
122 'chromium_revision': '223-3' 124 'chromium_revision': '223-3'
123 } 125 }
124 } 126 },
127 'failure_type': failure_type.COMPILE
125 } 128 }
126 129
127 self.mock( 130 self.mock(
128 try_job_util.swarming_tasks_to_try_job_pipeline, 131 try_job_util.swarming_tasks_to_try_job_pipeline,
129 'SwarmingTasksToTryJobPipeline', _MockRootPipeline) 132 'SwarmingTasksToTryJobPipeline', _MockRootPipeline)
130 _MockRootPipeline.STARTED = False 133 _MockRootPipeline.STARTED = False
131 134
132 try_job_util.ScheduleTryJobIfNeeded(failure_info, None, None) 135 try_job_util.ScheduleTryJobIfNeeded(failure_info, None, None)
133 136
134 self.assertFalse(_MockRootPipeline.STARTED) 137 self.assertFalse(_MockRootPipeline.STARTED)
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
348 }, 351 },
349 'builds': { 352 'builds': {
350 '222': { 353 '222': {
351 'blame_list': ['222-1'], 354 'blame_list': ['222-1'],
352 'chromium_revision': '222-1' 355 'chromium_revision': '222-1'
353 }, 356 },
354 '223': { 357 '223': {
355 'blame_list': ['223-1', '223-2', '223-3'], 358 'blame_list': ['223-1', '223-2', '223-3'],
356 'chromium_revision': '223-3' 359 'chromium_revision': '223-3'
357 } 360 }
358 } 361 },
362 'failure_type': failure_type.COMPILE
359 } 363 }
360 364
361 self.mock( 365 self.mock(
362 try_job_util.swarming_tasks_to_try_job_pipeline, 366 try_job_util.swarming_tasks_to_try_job_pipeline,
363 'SwarmingTasksToTryJobPipeline', _MockRootPipeline) 367 'SwarmingTasksToTryJobPipeline', _MockRootPipeline)
364 _MockRootPipeline.STARTED = False 368 _MockRootPipeline.STARTED = False
365 369
366 try_job_util.ScheduleTryJobIfNeeded(failure_info, None, None) 370 try_job_util.ScheduleTryJobIfNeeded(failure_info, None, None)
367 371
368 try_job = WfTryJob.Get(master_name, builder_name, build_number) 372 try_job = WfTryJob.Get(master_name, builder_name, build_number)
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
421 { 425 {
422 'step_name': 'steps' 426 'step_name': 'steps'
423 }, 427 },
424 ] 428 ]
425 } 429 }
426 expected_suspected_revisions = ['r1', 'r2'] 430 expected_suspected_revisions = ['r1', 'r2']
427 self.assertEqual( 431 self.assertEqual(
428 expected_suspected_revisions, 432 expected_suspected_revisions,
429 try_job_util._GetSuspectsForCompileFailureFromHeuristicResult( 433 try_job_util._GetSuspectsForCompileFailureFromHeuristicResult(
430 heuristic_result)) 434 heuristic_result))
OLDNEW
« no previous file with comments | « no previous file | appengine/findit/waterfall/try_job_util.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698