| 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 import json | 5 import json |
| 6 | 6 |
| 7 from common.git_repository import GitRepository | 7 from common.git_repository import GitRepository |
| 8 from common.pipeline_wrapper import pipeline_handlers | 8 from common.pipeline_wrapper import pipeline_handlers |
| 9 from common.waterfall import buildbucket_client | 9 from common.waterfall import buildbucket_client |
| 10 from model import result_status | 10 from model import result_status |
| (...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 206 analysis = WfAnalysis.Create(master_name, builder_name, build_number) | 206 analysis = WfAnalysis.Create(master_name, builder_name, build_number) |
| 207 analysis.put() | 207 analysis.put() |
| 208 | 208 |
| 209 root_pipeline = SwarmingTasksToTryJobPipeline( | 209 root_pipeline = SwarmingTasksToTryJobPipeline( |
| 210 master_name, builder_name, build_number, 'rev1', 'rev2', ['rev2'], | 210 master_name, builder_name, build_number, 'rev1', 'rev2', ['rev2'], |
| 211 TryJobType.COMPILE) | 211 TryJobType.COMPILE) |
| 212 root_pipeline.start() | 212 root_pipeline.start() |
| 213 self.execute_queued_tasks() | 213 self.execute_queued_tasks() |
| 214 | 214 |
| 215 try_job = WfTryJob.Get(master_name, builder_name, build_number) | 215 try_job = WfTryJob.Get(master_name, builder_name, build_number) |
| 216 analysis = WfAnalysis.Get(master_name, builder_name, build_number) |
| 216 | 217 |
| 217 expected_suspected_cl = { | 218 expected_suspected_cl = { |
| 218 'revision': 'rev2', | 219 'revision': 'rev2', |
| 219 'commit_position': '2', | 220 'commit_position': '2', |
| 220 'url': 'url_2', | 221 'url': 'url_2', |
| 221 'repo_name': 'chromium' | 222 'repo_name': 'chromium' |
| 222 } | 223 } |
| 223 | 224 |
| 224 expected_try_job_results = [ | 225 expected_try_job_results = [ |
| 225 { | 226 { |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 341 analysis = WfAnalysis.Create(master_name, builder_name, build_number) | 342 analysis = WfAnalysis.Create(master_name, builder_name, build_number) |
| 342 analysis.put() | 343 analysis.put() |
| 343 | 344 |
| 344 root_pipeline = SwarmingTasksToTryJobPipeline( | 345 root_pipeline = SwarmingTasksToTryJobPipeline( |
| 345 master_name, builder_name, build_number, 'rev0', 'rev1', ['rev1'], | 346 master_name, builder_name, build_number, 'rev0', 'rev1', ['rev1'], |
| 346 TryJobType.TEST, None, targeted_tests) | 347 TryJobType.TEST, None, targeted_tests) |
| 347 root_pipeline.start() | 348 root_pipeline.start() |
| 348 self.execute_queued_tasks() | 349 self.execute_queued_tasks() |
| 349 | 350 |
| 350 try_job = WfTryJob.Get(master_name, builder_name, build_number) | 351 try_job = WfTryJob.Get(master_name, builder_name, build_number) |
| 352 analysis = WfAnalysis.Get(master_name, builder_name, build_number) |
| 351 | 353 |
| 352 expected_suspected_cl = { | 354 expected_suspected_cl = { |
| 353 'revision': 'rev1', | 355 'revision': 'rev1', |
| 354 'commit_position': '1', | 356 'commit_position': '1', |
| 355 'url': 'url_1', | 357 'url': 'url_1', |
| 356 'repo_name': 'chromium' | 358 'repo_name': 'chromium' |
| 357 } | 359 } |
| 358 | 360 |
| 359 expected_try_job_results = [ | 361 expected_try_job_results = [ |
| 360 { | 362 { |
| (...skipping 25 matching lines...) Expand all Loading... |
| 386 } | 388 } |
| 387 } | 389 } |
| 388 } | 390 } |
| 389 } | 391 } |
| 390 ] | 392 ] |
| 391 | 393 |
| 392 self.assertEqual(expected_try_job_results, try_job.test_results) | 394 self.assertEqual(expected_try_job_results, try_job.test_results) |
| 393 self.assertEqual(analysis.result_status, | 395 self.assertEqual(analysis.result_status, |
| 394 result_status.FOUND_UNTRIAGED) | 396 result_status.FOUND_UNTRIAGED) |
| 395 self.assertEqual(analysis.suspected_cls, [expected_suspected_cl]) | 397 self.assertEqual(analysis.suspected_cls, [expected_suspected_cl]) |
| OLD | NEW |