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

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

Issue 2075423002: [Findit] Group failures by culprit and send notification to codereview. (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: Clean up. Created 4 years, 5 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 testing_utils import testing 5 from testing_utils import testing
6 6
7 from common.git_repository import GitRepository 7 from common.git_repository import GitRepository
8 from model import analysis_status 8 from model import analysis_status
9 from model import result_status 9 from model import result_status
10 from model.wf_analysis import WfAnalysis 10 from model.wf_analysis import WfAnalysis
(...skipping 912 matching lines...) Expand 10 before | Expand all | Expand 10 after
923 'tests': { 923 'tests': {
924 'Test1': { 924 'Test1': {
925 'revision': 'rev1' 925 'revision': 'rev1'
926 } 926 }
927 } 927 }
928 } 928 }
929 } 929 }
930 930
931 self.assertEqual(culprit_map, expected_culprit_map) 931 self.assertEqual(culprit_map, expected_culprit_map)
932 self.assertEqual(failed_revisions, ['rev1']) 932 self.assertEqual(failed_revisions, ['rev1'])
933
934 def testNotifyCulprits(self):
935 instances = []
936 class Mocked_SendNotificationForCulpritPipeline(object):
937 def __init__(self, *args):
938 self.args = args
939 self.started = False
940 instances.append(self)
941
942 def start(self):
943 self.started = True
944
945 self.mock(
946 identify_try_job_culprit_pipeline, 'SendNotificationForCulpritPipeline',
947 Mocked_SendNotificationForCulpritPipeline)
948
949 culprits = {
950 'r1': {
951 'repo_name': 'chromium',
952 'revision': 'r1',
953 }
954 }
955
956 identify_try_job_culprit_pipeline._NotifyCulprits('m', 'b', 1, culprits)
957 self.assertEqual(1, len(instances))
958 self.assertTrue(instances[0].started)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698