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

Side by Side Diff: appengine/findit/waterfall/flake/test/recursive_flake_pipeline_test.py

Issue 2538533002: [Findit] Report the error from the last flake swarming task that failed in master_flake_analysis.py (Closed)
Patch Set: Created 4 years 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
« no previous file with comments | « appengine/findit/waterfall/flake/recursive_flake_pipeline.py ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2016 The Chromium Authors. All rights reserved. 1 # Copyright 2016 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 import mock 6 import mock
7 7
8 from common import constants 8 from common import constants
9 from common.pipeline_wrapper import pipeline_handlers 9 from common.pipeline_wrapper import pipeline_handlers
10 from model import analysis_status 10 from model import analysis_status
(...skipping 848 matching lines...) Expand 10 before | Expand all | Expand 10 after
859 master_name, builder_name, master_build_number, step_name, test_name) 859 master_name, builder_name, master_build_number, step_name, test_name)
860 self.assertEqual(analysis_status.COMPLETED, analysis.status) 860 self.assertEqual(analysis_status.COMPLETED, analysis.status)
861 861
862 def testUpdateAnalysisUponCompletionFound(self): 862 def testUpdateAnalysisUponCompletionFound(self):
863 analysis = MasterFlakeAnalysis.Create('m', 'b', 123, 's', 't') 863 analysis = MasterFlakeAnalysis.Create('m', 'b', 123, 's', 't')
864 analysis.suspected_flake_build_number = 100 864 analysis.suspected_flake_build_number = 100
865 recursive_flake_pipeline._UpdateAnalysisStatusUponCompletion( 865 recursive_flake_pipeline._UpdateAnalysisStatusUponCompletion(
866 analysis, analysis_status.COMPLETED, None) 866 analysis, analysis_status.COMPLETED, None)
867 self.assertEqual(analysis.result_status, result_status.FOUND_UNTRIAGED) 867 self.assertEqual(analysis.result_status, result_status.FOUND_UNTRIAGED)
868 868
869 def testUpdateAnalysisUponCompletionError(self):
chanli 2016/11/28 22:27:54 This test case is not what I expect for your new c
lijeffrey 2016/11/28 23:37:09 Done.
870 expected_error = {
871 'code': 1,
872 'message': 'some error message'
873 }
874 analysis = MasterFlakeAnalysis.Create('m', 'b', 123, 's', 't')
875 analysis.suspected_flake_build_number = 100
876 recursive_flake_pipeline._UpdateAnalysisStatusUponCompletion(
877 analysis, analysis_status.COMPLETED, expected_error)
878 self.assertEqual(expected_error, analysis.error)
879
869 def testGetListOfNearbyBuildNumbers(self): 880 def testGetListOfNearbyBuildNumbers(self):
870 self.assertEqual( 881 self.assertEqual(
871 [1], 882 [1],
872 recursive_flake_pipeline._GetListOfNearbyBuildNumbers(1, 0)) 883 recursive_flake_pipeline._GetListOfNearbyBuildNumbers(1, 0))
873 self.assertEqual( 884 self.assertEqual(
874 [1], 885 [1],
875 recursive_flake_pipeline._GetListOfNearbyBuildNumbers(1, -1)) 886 recursive_flake_pipeline._GetListOfNearbyBuildNumbers(1, -1))
876 self.assertEqual( 887 self.assertEqual(
877 [1, 2], 888 [1, 2],
878 recursive_flake_pipeline._GetListOfNearbyBuildNumbers(1, 1)) 889 recursive_flake_pipeline._GetListOfNearbyBuildNumbers(1, 1))
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after
1109 calls = mocked_pipeline.mock_calls 1120 calls = mocked_pipeline.mock_calls
1110 self.assertEqual(2, len(calls)) 1121 self.assertEqual(2, len(calls))
1111 1122
1112 _, args, __ = calls[0] 1123 _, args, __ = calls[0]
1113 bug_id, comment, labels = args 1124 bug_id, comment, labels = args
1114 self.assertEqual(123, bug_id) 1125 self.assertEqual(123, bug_id)
1115 self.assertEqual(['AnalyzedByFindit'], labels) 1126 self.assertEqual(['AnalyzedByFindit'], labels)
1116 self.assertTrue('om / ob / os' in comment) 1127 self.assertTrue('om / ob / os' in comment)
1117 1128
1118 self.assertEqual(mock.call().start(queue_name='queue'), calls[1]) 1129 self.assertEqual(mock.call().start(queue_name='queue'), calls[1])
OLDNEW
« no previous file with comments | « appengine/findit/waterfall/flake/recursive_flake_pipeline.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698