| OLD | NEW |
| 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 datetime import datetime | 5 from datetime import datetime |
| 6 from datetime import timedelta | 6 from datetime import timedelta |
| 7 | 7 |
| 8 from common.waterfall import failure_type | 8 from common.waterfall import failure_type |
| 9 from model import analysis_status | 9 from model import analysis_status |
| 10 from model.wf_analysis import WfAnalysis | 10 from model.wf_analysis import WfAnalysis |
| (...skipping 1250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1261 {'source': 'b.cc', 'target': 'b.o'}, | 1261 {'source': 'b.cc', 'target': 'b.o'}, |
| 1262 ] | 1262 ] |
| 1263 } | 1263 } |
| 1264 } | 1264 } |
| 1265 | 1265 |
| 1266 self.assertEqual( | 1266 self.assertEqual( |
| 1267 try_job_util._GetFailedTargetsFromSignals( | 1267 try_job_util._GetFailedTargetsFromSignals( |
| 1268 signals, 'master1', 'builder1'), | 1268 signals, 'master1', 'builder1'), |
| 1269 ['b.o']) | 1269 ['b.o']) |
| 1270 | 1270 |
| 1271 def testRemovePlatformFromStepName(self): |
| 1272 self.assertEqual('a_tests', |
| 1273 try_job_util._RemovePlatformFromStepName('a_tests on Platform')) |
| 1274 self.assertEqual('a_tests', |
| 1275 try_job_util._RemovePlatformFromStepName('a_tests on Other-Platform')) |
| 1276 self.assertEqual('a_tests', |
| 1277 try_job_util._RemovePlatformFromStepName('a_tests')) |
| 1278 |
| 1271 def testGetSuspectedCLsWithFailuresNoHeuristicResult(self): | 1279 def testGetSuspectedCLsWithFailuresNoHeuristicResult(self): |
| 1272 heuristic_result = None | 1280 heuristic_result = None |
| 1273 expected_suspected_revisions = [] | 1281 expected_suspected_revisions = [] |
| 1274 self.assertEqual( | 1282 self.assertEqual( |
| 1275 expected_suspected_revisions, | 1283 expected_suspected_revisions, |
| 1276 sorted(try_job_util.GetSuspectedCLsWithFailures(heuristic_result))) | 1284 sorted(try_job_util.GetSuspectedCLsWithFailures(heuristic_result))) |
| 1277 | 1285 |
| 1278 def testGetSuspectedCLsWithFailuresEmptyHeuristicResult(self): | 1286 def testGetSuspectedCLsWithFailuresEmptyHeuristicResult(self): |
| 1279 heuristic_result = {} | 1287 heuristic_result = {} |
| 1280 expected_suspected_revisions = [] | 1288 expected_suspected_revisions = [] |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1396 try_job_util._GetSuspectsFromHeuristicResult(heuristic_result)) | 1404 try_job_util._GetSuspectsFromHeuristicResult(heuristic_result)) |
| 1397 | 1405 |
| 1398 def testShouldBailOutforOutdatedBuild(self): | 1406 def testShouldBailOutforOutdatedBuild(self): |
| 1399 yesterday = datetime.utcnow() - timedelta(days=1) | 1407 yesterday = datetime.utcnow() - timedelta(days=1) |
| 1400 build = WfBuild.Create('m', 'b', 1) | 1408 build = WfBuild.Create('m', 'b', 1) |
| 1401 build.start_time = yesterday | 1409 build.start_time = yesterday |
| 1402 self.assertTrue(try_job_util._ShouldBailOutForOutdatedBuild(build)) | 1410 self.assertTrue(try_job_util._ShouldBailOutForOutdatedBuild(build)) |
| 1403 | 1411 |
| 1404 build.start_time = yesterday + timedelta(hours=1) | 1412 build.start_time = yesterday + timedelta(hours=1) |
| 1405 self.assertFalse(try_job_util._ShouldBailOutForOutdatedBuild(build)) | 1413 self.assertFalse(try_job_util._ShouldBailOutForOutdatedBuild(build)) |
| OLD | NEW |