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

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

Issue 2290833002: [Findit] Fix a bug that MonitorTryJobPipeline still runs when no try job scheduled. (Closed)
Patch Set: removed unwanted code. Created 4 years, 3 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 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 import result_status 10 from model import result_status
(...skipping 938 matching lines...) Expand 10 before | Expand all | Expand 10 after
949 culprits = { 949 culprits = {
950 'r1': { 950 'r1': {
951 'repo_name': 'chromium', 951 'repo_name': 'chromium',
952 'revision': 'r1', 952 'revision': 'r1',
953 } 953 }
954 } 954 }
955 955
956 identify_try_job_culprit_pipeline._NotifyCulprits('m', 'b', 1, culprits) 956 identify_try_job_culprit_pipeline._NotifyCulprits('m', 'b', 1, culprits)
957 self.assertEqual(1, len(instances)) 957 self.assertEqual(1, len(instances))
958 self.assertTrue(instances[0].started) 958 self.assertTrue(instances[0].started)
959
960 def testReturnNoneIfNoTryJob(self):
961 master_name = 'm'
962 builder_name = 'b'
963 build_number = 8
964
965 try_job = WfTryJob.Create(master_name, builder_name, build_number).put()
966 pipeline = IdentifyTryJobCulpritPipeline()
967 culprit = pipeline.run(master_name, builder_name, build_number, ['rev1'],
968 failure_type.TEST, None, None)
969 self.assertIsNone(culprit)
970
971 try_job = WfTryJob.Get(master_name, builder_name, build_number)
972 self.assertEqual(try_job.test_results, [])
973 self.assertEqual(try_job.status, analysis_status.COMPLETED)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698