Chromium Code Reviews| 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 1175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1186 {'source': 'b.cc', 'target': 'b.o'}, | 1186 {'source': 'b.cc', 'target': 'b.o'}, |
| 1187 ] | 1187 ] |
| 1188 } | 1188 } |
| 1189 } | 1189 } |
| 1190 | 1190 |
| 1191 self.assertEqual( | 1191 self.assertEqual( |
| 1192 try_job_util._GetFailedTargetsFromSignals( | 1192 try_job_util._GetFailedTargetsFromSignals( |
| 1193 signals, 'master1', 'builder1'), | 1193 signals, 'master1', 'builder1'), |
| 1194 ['b.o']) | 1194 ['b.o']) |
| 1195 | 1195 |
| 1196 def testChopOffPlatformFromStepName(self): | |
| 1197 test_pairs = [ | |
| 1198 ('a_tests on Platform', 'a_tests on '), | |
|
lijeffrey
2016/08/10 18:48:08
so why should the ' on ' be left in?
lijeffrey
2016/08/10 18:48:08
it's easier just to make 1 for each of these
self
josiahk
2016/08/10 21:22:34
So that 'super_tests on Windows' doesn't match 'su
josiahk
2016/08/10 21:22:34
Done.
| |
| 1199 ('a_tests on Other-Platform', 'a_tests on '), | |
| 1200 ('b_tests', 'b_tests')] | |
| 1201 | |
| 1202 for test_pair in test_pairs: | |
| 1203 self.assertEqual( | |
| 1204 try_job_util._ChopOffPlatformFromStepName(test_pair[0]), | |
| 1205 test_pair[1]) | |
| 1206 | |
| 1196 def testGetSuspectedCLsWithFailuresNoHeuristicResult(self): | 1207 def testGetSuspectedCLsWithFailuresNoHeuristicResult(self): |
| 1197 heuristic_result = None | 1208 heuristic_result = None |
| 1198 expected_suspected_revisions = [] | 1209 expected_suspected_revisions = [] |
| 1199 self.assertEqual( | 1210 self.assertEqual( |
| 1200 expected_suspected_revisions, | 1211 expected_suspected_revisions, |
| 1201 sorted(try_job_util.GetSuspectedCLsWithFailures(heuristic_result))) | 1212 sorted(try_job_util.GetSuspectedCLsWithFailures(heuristic_result))) |
| 1202 | 1213 |
| 1203 def testGetSuspectedCLsWithFailuresEmptyHeuristicResult(self): | 1214 def testGetSuspectedCLsWithFailuresEmptyHeuristicResult(self): |
| 1204 heuristic_result = {} | 1215 heuristic_result = {} |
| 1205 expected_suspected_revisions = [] | 1216 expected_suspected_revisions = [] |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1321 try_job_util._GetSuspectsFromHeuristicResult(heuristic_result)) | 1332 try_job_util._GetSuspectsFromHeuristicResult(heuristic_result)) |
| 1322 | 1333 |
| 1323 def testShouldBailOutforOutdatedBuild(self): | 1334 def testShouldBailOutforOutdatedBuild(self): |
| 1324 yesterday = datetime.utcnow() - timedelta(days=1) | 1335 yesterday = datetime.utcnow() - timedelta(days=1) |
| 1325 build = WfBuild.Create('m', 'b', 1) | 1336 build = WfBuild.Create('m', 'b', 1) |
| 1326 build.start_time = yesterday | 1337 build.start_time = yesterday |
| 1327 self.assertTrue(try_job_util._ShouldBailOutForOutdatedBuild(build)) | 1338 self.assertTrue(try_job_util._ShouldBailOutForOutdatedBuild(build)) |
| 1328 | 1339 |
| 1329 build.start_time = yesterday + timedelta(hours=1) | 1340 build.start_time = yesterday + timedelta(hours=1) |
| 1330 self.assertFalse(try_job_util._ShouldBailOutForOutdatedBuild(build)) | 1341 self.assertFalse(try_job_util._ShouldBailOutForOutdatedBuild(build)) |
| OLD | NEW |