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

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

Issue 1933013003: [Findit] Extract failed output nodes from stdio log of compile step. (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: Address comments. Created 4 years, 7 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 common.waterfall import failure_type 5 from common.waterfall import failure_type
6 from model import analysis_status 6 from model import analysis_status
7 from model.wf_try_job import WfTryJob 7 from model.wf_try_job import WfTryJob
8 from waterfall import try_job_util 8 from waterfall import try_job_util
9 from waterfall.test import wf_testcase 9 from waterfall.test import wf_testcase
10 from waterfall.try_job_type import TryJobType 10 from waterfall.try_job_type import TryJobType
(...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after
367 'SwarmingTasksToTryJobPipeline', _MockRootPipeline) 367 'SwarmingTasksToTryJobPipeline', _MockRootPipeline)
368 _MockRootPipeline.STARTED = False 368 _MockRootPipeline.STARTED = False
369 369
370 try_job_util.ScheduleTryJobIfNeeded(failure_info, None, None) 370 try_job_util.ScheduleTryJobIfNeeded(failure_info, None, None)
371 371
372 try_job = WfTryJob.Get(master_name, builder_name, build_number) 372 try_job = WfTryJob.Get(master_name, builder_name, build_number)
373 373
374 self.assertTrue(_MockRootPipeline.STARTED) 374 self.assertTrue(_MockRootPipeline.STARTED)
375 self.assertIsNotNone(try_job) 375 self.assertIsNotNone(try_job)
376 376
377 def testUseFailedOutputNodesFromSignals(self):
378 signals = {
379 'compile': {
380 'failed_targets': [
381 {'target': 'a.exe'},
382 {'source': 'b.cc', 'target': 'b.o'},
383 ],
384 'failed_output_nodes': ['a', 'b'],
385 }
386 }
387
388 self.assertEqual(
389 try_job_util._GetFailedTargetsFromSignals(signals, 'm', 'b'),
390 ['a', 'b'])
391
377 def testGetFailedTargetsFromSignals(self): 392 def testGetFailedTargetsFromSignals(self):
378 self.assertEqual( 393 self.assertEqual(
379 try_job_util._GetFailedTargetsFromSignals({}, 'm', 'b'), []) 394 try_job_util._GetFailedTargetsFromSignals({}, 'm', 'b'), [])
380 395
381 self.assertEqual( 396 self.assertEqual(
382 try_job_util._GetFailedTargetsFromSignals({'compile': {}}, 'm', 'b'), 397 try_job_util._GetFailedTargetsFromSignals({'compile': {}}, 'm', 'b'),
383 []) 398 [])
384 399
385 signals = { 400 signals = {
386 'compile': { 401 'compile': {
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
425 { 440 {
426 'step_name': 'steps' 441 'step_name': 'steps'
427 }, 442 },
428 ] 443 ]
429 } 444 }
430 expected_suspected_revisions = ['r1', 'r2'] 445 expected_suspected_revisions = ['r1', 'r2']
431 self.assertEqual( 446 self.assertEqual(
432 expected_suspected_revisions, 447 expected_suspected_revisions,
433 try_job_util._GetSuspectsForCompileFailureFromHeuristicResult( 448 try_job_util._GetSuspectsForCompileFailureFromHeuristicResult(
434 heuristic_result)) 449 heuristic_result))
OLDNEW
« no previous file with comments | « appengine/findit/waterfall/test/failure_signal_test.py ('k') | appengine/findit/waterfall/try_job_util.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698