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

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

Issue 1652603003: [Findit] Modify result page to display tryjob result for test failure. (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@1228-try-job-pipeline-for-test-failure
Patch Set: . Created 4 years, 10 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 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 testing_utils import testing 5 from testing_utils import testing
6 6
7 from common.git_repository import GitRepository 7 from common.git_repository import GitRepository
8 from model import wf_analysis_status 8 from model import wf_analysis_status
9 from model.wf_try_job import WfTryJob 9 from model.wf_try_job import WfTryJob
10 from waterfall.identify_try_job_culprit_pipeline import( 10 from waterfall.identify_try_job_culprit_pipeline import(
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 TryJobType.COMPILE, '1', compile_result) 131 TryJobType.COMPILE, '1', compile_result)
132 expected_compile_result = { 132 expected_compile_result = {
133 'report': { 133 'report': {
134 'result': { 134 'result': {
135 'rev1': 'passed', 135 'rev1': 'passed',
136 'rev2': 'failed' 136 'rev2': 'failed'
137 } 137 }
138 }, 138 },
139 'try_job_id': '1', 139 'try_job_id': '1',
140 'culprit': { 140 'culprit': {
141 'revision': 'rev2', 141 'compile': {
142 'commit_position': '2', 142 'revision': 'rev2',
143 'review_url': 'url_2' 143 'commit_position': '2',
144 'review_url': 'url_2'
145 }
144 } 146 }
145 } 147 }
146 148
147 self.assertEqual(expected_compile_result['culprit'], culprit) 149 self.assertEqual(expected_compile_result['culprit'], culprit)
148 150
149 try_job = WfTryJob.Get(master_name, builder_name, build_number) 151 try_job = WfTryJob.Get(master_name, builder_name, build_number)
150 152
151 self.assertEqual(expected_compile_result, try_job.compile_results[-1]) 153 self.assertEqual(expected_compile_result, try_job.compile_results[-1])
152 self.assertEqual(wf_analysis_status.ANALYZED, try_job.status) 154 self.assertEqual(wf_analysis_status.ANALYZED, try_job.status)
153 155
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 TryJobType.COMPILE, '1', compile_result) 204 TryJobType.COMPILE, '1', compile_result)
203 205
204 expected_compile_result = { 206 expected_compile_result = {
205 'report': [ 207 'report': [
206 ['rev1', 'passed'], 208 ['rev1', 'passed'],
207 ['rev2', 'failed'] 209 ['rev2', 'failed']
208 ], 210 ],
209 'url': 'url', 211 'url': 'url',
210 'try_job_id': '1', 212 'try_job_id': '1',
211 'culprit': { 213 'culprit': {
212 'revision': 'rev2', 214 'compile': {
213 'commit_position': '2', 215 'revision': 'rev2',
214 'review_url': 'url_2' 216 'commit_position': '2',
217 'review_url': 'url_2'
218 }
215 } 219 }
216 } 220 }
217 221
218 self.assertEqual(expected_compile_result['culprit'], culprit) 222 self.assertEqual(expected_compile_result['culprit'], culprit)
219 223
220 try_job = WfTryJob.Get(master_name, builder_name, build_number) 224 try_job = WfTryJob.Get(master_name, builder_name, build_number)
221 self.assertEqual(expected_compile_result, try_job.compile_results[-1]) 225 self.assertEqual(expected_compile_result, try_job.compile_results[-1])
222 self.assertEqual(wf_analysis_status.ANALYZED, try_job.status) 226 self.assertEqual(wf_analysis_status.ANALYZED, try_job.status)
223 227
224 def testIdentifyCulpritForTestTryJobReturnNoneIfNoTryJobResult(self): 228 def testIdentifyCulpritForTestTryJobReturnNoneIfNoTryJobResult(self):
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
427 'tests': {} 431 'tests': {}
428 } 432 }
429 } 433 }
430 } 434 }
431 435
432 self.assertEqual(expected_test_result['culprit'], culprit) 436 self.assertEqual(expected_test_result['culprit'], culprit)
433 437
434 try_job = WfTryJob.Get(master_name, builder_name, build_number) 438 try_job = WfTryJob.Get(master_name, builder_name, build_number)
435 self.assertEqual(expected_test_result, try_job.test_results[-1]) 439 self.assertEqual(expected_test_result, try_job.test_results[-1])
436 self.assertEqual(wf_analysis_status.ANALYZED, try_job.status) 440 self.assertEqual(wf_analysis_status.ANALYZED, try_job.status)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698