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

Side by Side Diff: appengine/findit/crash/test/crash_pipeline_test.py

Issue 2378133004: [Findit] Rerun if the regression range is different. (Closed)
Patch Set: Fix nits. Created 4 years, 2 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 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 import copy 4 import copy
5 import json 5 import json
6 6
7 from google.appengine.api import app_identity 7 from google.appengine.api import app_identity
8 8
9 from common.pipeline_wrapper import pipeline_handlers 9 from common.pipeline_wrapper import pipeline_handlers
10 from crash import crash_pipeline 10 from crash import crash_pipeline
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 platform = 'win' 146 platform = 'win'
147 channel = 'canary' 147 channel = 'canary'
148 crash_identifiers = { 148 crash_identifiers = {
149 'chrome_version': chrome_version, 149 'chrome_version': chrome_version,
150 'signature': signature, 150 'signature': signature,
151 'channel': channel, 151 'channel': channel,
152 'platform': platform, 152 'platform': platform,
153 'process_type': 'browser', 153 'process_type': 'browser',
154 } 154 }
155 stack_trace = 'frame1\nframe2\nframe3' 155 stack_trace = 'frame1\nframe2\nframe3'
156 chrome_version = '50.2500.0.0' 156 chrome_version = '50.2500.0.1'
157 historical_metadata = {'50.2500.0.0': 1.0} 157 historical_metadata = None
158 158
159 mock_host = 'https://host.com' 159 mock_host = 'https://host.com'
160 self.mock(app_identity, 'get_default_version_hostname', lambda: mock_host) 160 self.mock(app_identity, 'get_default_version_hostname', lambda: mock_host)
161 161
162 self.assertTrue( 162 self.assertTrue(
163 crash_pipeline.ScheduleNewAnalysisForCrash( 163 crash_pipeline.ScheduleNewAnalysisForCrash(
164 crash_identifiers, chrome_version, signature, 'fracas', 164 crash_identifiers, chrome_version, signature, 'fracas',
165 platform, stack_trace, 165 platform, stack_trace,
166 {'channel': channel, 'historical_metadata': historical_metadata})) 166 {'channel': channel, 'historical_metadata': historical_metadata}))
167 167
(...skipping 14 matching lines...) Expand all
182 182
183 expected_messages_data = [json.dumps({ 183 expected_messages_data = [json.dumps({
184 'crash_identifiers': crash_identifiers, 184 'crash_identifiers': crash_identifiers,
185 'client_id': 'fracas', 185 'client_id': 'fracas',
186 'result': processed_analysis_result, 186 'result': processed_analysis_result,
187 }, sort_keys=True)] 187 }, sort_keys=True)]
188 self.assertEqual(expected_messages_data, pubsub_publish_requests[0][0]) 188 self.assertEqual(expected_messages_data, pubsub_publish_requests[0][0])
189 189
190 self.assertEqual(1, len(analyzed_crashes)) 190 self.assertEqual(1, len(analyzed_crashes))
191 self.assertEqual( 191 self.assertEqual(
192 (signature, platform, stack_trace, chrome_version, historical_metadata), 192 (signature, platform, stack_trace, chrome_version, None),
193 analyzed_crashes[0]) 193 analyzed_crashes[0])
194 194
195 analysis = FracasCrashAnalysis.Get(crash_identifiers) 195 analysis = FracasCrashAnalysis.Get(crash_identifiers)
196 self.assertEqual(analysis_result, analysis.result) 196 self.assertEqual(analysis_result, analysis.result)
197 return analysis 197 return analysis
198 198
199 199
200 def testRunningAnalysis(self): 200 def testRunningAnalysis(self):
201 analysis_result = { 201 analysis_result = {
202 'found': True, 202 'found': True,
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
268 'process_type': 'browser', 268 'process_type': 'browser',
269 } 269 }
270 analysis = FracasCrashAnalysis.Create(crash_identifiers) 270 analysis = FracasCrashAnalysis.Create(crash_identifiers)
271 analysis.status = analysis_status.RUNNING 271 analysis.status = analysis_status.RUNNING
272 analysis.put() 272 analysis.put()
273 273
274 pipeline = crash_pipeline.CrashAnalysisPipeline(crash_identifiers, 'fracas') 274 pipeline = crash_pipeline.CrashAnalysisPipeline(crash_identifiers, 'fracas')
275 pipeline._SetErrorIfAborted(True) 275 pipeline._SetErrorIfAborted(True)
276 analysis = FracasCrashAnalysis.Get(crash_identifiers) 276 analysis = FracasCrashAnalysis.Get(crash_identifiers)
277 self.assertEqual(analysis_status.ERROR, analysis.status) 277 self.assertEqual(analysis_status.ERROR, analysis.status)
OLDNEW
« no previous file with comments | « appengine/findit/crash/findit_for_client.py ('k') | appengine/findit/crash/test/findit_for_chromecrash_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698