| OLD | NEW |
| 1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 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 os | 5 import os |
| 6 import re | 6 import re |
| 7 | 7 |
| 8 from google.appengine.ext import testbed | 8 from google.appengine.ext import testbed |
| 9 | 9 |
| 10 import webapp2 | 10 import webapp2 |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 'tests': ['test4'] | 67 'tests': ['test4'] |
| 68 }, | 68 }, |
| 69 { | 69 { |
| 70 'ref_name': 'step1', | 70 'ref_name': 'step1', |
| 71 'try_job_key': 'm/b/120', | 71 'try_job_key': 'm/b/120', |
| 72 'status': result_status.NO_TRY_JOB_REASON_MAP[ | 72 'status': result_status.NO_TRY_JOB_REASON_MAP[ |
| 73 analysis_status.PENDING], | 73 analysis_status.PENDING], |
| 74 'task_id': 'task2', | 74 'task_id': 'task2', |
| 75 'task_url': 'url/task2', | 75 'task_url': 'url/task2', |
| 76 'tests': ['test1'] | 76 'tests': ['test1'] |
| 77 }, |
| 78 { |
| 79 'ref_name': 'step1', |
| 80 'try_job_key': 'm/b/120', |
| 81 'task_id': 'task2', |
| 82 'task_url': 'url/task2', |
| 83 'tests': ['test5'] |
| 77 } | 84 } |
| 78 ] | 85 ] |
| 79 } | 86 } |
| 80 }, | 87 }, |
| 81 'm/b/120': { | 88 'm/b/120': { |
| 82 'compile': { | 89 'compile': { |
| 83 'try_jobs': [ | 90 'try_jobs': [ |
| 84 { | 91 { |
| 85 'try_job_key': 'm/b/120', | 92 'try_job_key': 'm/b/120', |
| 86 'status': analysis_status.COMPLETED, | 93 'status': analysis_status.COMPLETED, |
| (...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 400 'last_pass': 118, | 407 'last_pass': 118, |
| 401 'supported': True, | 408 'supported': True, |
| 402 'suspected_cls': [], | 409 'suspected_cls': [], |
| 403 'tests': ['test4'] | 410 'tests': ['test4'] |
| 404 }, | 411 }, |
| 405 { | 412 { |
| 406 'first_failure': 120, | 413 'first_failure': 120, |
| 407 'last_pass': 119, | 414 'last_pass': 119, |
| 408 'supported': True, | 415 'supported': True, |
| 409 'suspected_cls': [], | 416 'suspected_cls': [], |
| 410 'tests': ['test1'] | 417 'tests': ['test1', 'test5'] |
| 411 } | 418 } |
| 412 ] | 419 ] |
| 413 } | 420 } |
| 414 | 421 |
| 415 updated_result = build_failure._GetAnalysisResultWithTryJobInfo( | 422 updated_result = build_failure._GetAnalysisResultWithTryJobInfo( |
| 416 organized_results, master_name, builder_name, build_number) | 423 organized_results, master_name, builder_name, build_number) |
| 417 | 424 |
| 418 expected_result = { | 425 expected_result = { |
| 419 'step1 on platform':{ | 426 'step1 on platform':{ |
| 420 'results': { | 427 'results': { |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 511 'first_failure': 119, | 518 'first_failure': 119, |
| 512 'last_pass': 118, | 519 'last_pass': 118, |
| 513 'supported': True | 520 'supported': True |
| 514 } | 521 } |
| 515 ], | 522 ], |
| 516 'unclassified_failures': [ | 523 'unclassified_failures': [ |
| 517 { | 524 { |
| 518 'try_job':{ | 525 'try_job':{ |
| 519 'ref_name': 'step1', | 526 'ref_name': 'step1', |
| 520 'try_job_key': 'm/b/120', | 527 'try_job_key': 'm/b/120', |
| 528 'status': result_status.UNKNOWN, |
| 529 'task_id': 'task2', |
| 530 'task_url': 'url/task2', |
| 531 'tests': ['test5'] |
| 532 }, |
| 533 'heuristic_analysis': { |
| 534 'suspected_cls': [] |
| 535 }, |
| 536 'tests': ['test5'], |
| 537 'first_failure': 120, |
| 538 'last_pass': 119, |
| 539 'supported': True |
| 540 }, |
| 541 { |
| 542 'try_job':{ |
| 543 'ref_name': 'step1', |
| 544 'try_job_key': 'm/b/120', |
| 521 'status': result_status.NO_TRY_JOB_REASON_MAP[ | 545 'status': result_status.NO_TRY_JOB_REASON_MAP[ |
| 522 analysis_status.PENDING], | 546 analysis_status.PENDING], |
| 523 'task_id': 'task2', | 547 'task_id': 'task2', |
| 524 'task_url': 'url/task2', | 548 'task_url': 'url/task2', |
| 525 'tests': ['test1'] | 549 'tests': ['test1'] |
| 526 }, | 550 }, |
| 527 'heuristic_analysis': { | 551 'heuristic_analysis': { |
| 528 'suspected_cls': [] | 552 'suspected_cls': [] |
| 529 }, | 553 }, |
| 530 'tests': ['test1'], | 554 'tests': ['test1'], |
| (...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 737 }, | 761 }, |
| 738 'failed': False, | 762 'failed': False, |
| 739 } | 763 } |
| 740 | 764 |
| 741 build_url = buildbot.CreateBuildUrl('m', 'b', 123) | 765 build_url = buildbot.CreateBuildUrl('m', 'b', 123) |
| 742 response = self.test_app.get('/build-failure', | 766 response = self.test_app.get('/build-failure', |
| 743 params={'url': build_url, 'format': 'json'}) | 767 params={'url': build_url, 'format': 'json'}) |
| 744 | 768 |
| 745 self.assertEquals(200, response.status_int) | 769 self.assertEquals(200, response.status_int) |
| 746 self.assertEqual(expected_try_job_result, response.json_body['try_job']) | 770 self.assertEqual(expected_try_job_result, response.json_body['try_job']) |
| OLD | NEW |