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

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

Issue 1924823003: [Findit] Use heuristic analysis result for test try jobs(Findit side). (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 390 matching lines...) Expand 10 before | Expand all | Expand 10 after
401 {'source': 'b.cc', 'target': 'b.o'}, 401 {'source': 'b.cc', 'target': 'b.o'},
402 ] 402 ]
403 } 403 }
404 } 404 }
405 405
406 self.assertEqual( 406 self.assertEqual(
407 try_job_util._GetFailedTargetsFromSignals( 407 try_job_util._GetFailedTargetsFromSignals(
408 signals, 'master1', 'builder1'), 408 signals, 'master1', 'builder1'),
409 ['b.o']) 409 ['b.o'])
410 410
411 def testGetSuspectsForCompileFailureFromHeuristicResult(self): 411 def testGetSuspectsFromHeuristicResultForCompile(self):
412 heuristic_result = { 412 heuristic_result = {
413 'failures': [ 413 'failures': [
414 { 414 {
415 'step_name': 'compile', 415 'step_name': 'compile',
416 'suspected_cls': [ 416 'suspected_cls': [
417 { 417 {
418 'revision': 'r1', 418 'revision': 'r1',
419 }, 419 },
420 { 420 {
421 'revision': 'r2', 421 'revision': 'r2',
422 }, 422 },
423 ], 423 ],
424 }, 424 },
425 {
426 'step_name': 'steps'
427 },
428 ] 425 ]
429 } 426 }
430 expected_suspected_revisions = ['r1', 'r2'] 427 expected_suspected_revisions = ['r1', 'r2']
431 self.assertEqual( 428 self.assertEqual(
432 expected_suspected_revisions, 429 expected_suspected_revisions,
433 try_job_util._GetSuspectsForCompileFailureFromHeuristicResult( 430 try_job_util._GetSuspectsFromHeuristicResult(heuristic_result))
434 heuristic_result)) 431
432 def testGetSuspectsFromHeuristicResultForTest(self):
433 heuristic_result = {
434 'failures': [
435 {
436 'step_name': 'step1',
437 'suspected_cls': [
438 {
439 'revision': 'r1',
440 },
441 {
442 'revision': 'r2',
443 },
444 ],
445 },
446 {
447 'step_name': 'step2',
448 'suspected_cls': [
449 {
450 'revision': 'r1',
451 },
452 {
453 'revision': 'r3',
454 },
455 ],
456 },
457 ]
458 }
459 expected_suspected_revisions = ['r1', 'r2', 'r3']
460 self.assertEqual(
461 expected_suspected_revisions,
462 try_job_util._GetSuspectsFromHeuristicResult(heuristic_result))
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698