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

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

Issue 2457153002: replacing the NullCulprit class by None (Closed)
Patch Set: rebase Created 4 years, 1 month 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/crash/culprit.py ('k') | appengine/findit/crash/test/crash_pipeline_test.py » ('j') | 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 import copy 5 import copy
6 import logging 6 import logging
7 7
8 from google.appengine.ext import ndb 8 from google.appengine.ext import ndb
9 9
10 from common import appengine_util 10 from common import appengine_util
11 from common import chrome_dependency_fetcher 11 from common import chrome_dependency_fetcher
12 from common import constants 12 from common import constants
13 from common import time_util 13 from common import time_util
14 from crash.crash_report import CrashReport 14 from crash.crash_report import CrashReport
15 from crash.culprit import Culprit
16 from model import analysis_status 15 from model import analysis_status
17 from model.crash.crash_config import CrashConfig 16 from model.crash.crash_config import CrashConfig
18 17
19 # TODO(http://crbug.com/659346): since most of our unit tests are 18 # TODO(http://crbug.com/659346): since most of our unit tests are
20 # FinditForFracas-specific, wrengr moved them to findit_for_chromecrash_test.py. 19 # FinditForFracas-specific, wrengr moved them to findit_for_chromecrash_test.py.
21 # However, now we're missing coverage for most of this file (due to the 20 # However, now we're missing coverage for most of this file (due to the
22 # buggy way coverage is computed). Need to add a bunch of new unittests 21 # buggy way coverage is computed). Need to add a bunch of new unittests
23 # to get coverage back up. 22 # to get coverage back up.
24 23
25 # TODO: this class depends on ndb stuff, and should therefore move to 24 # TODO: this class depends on ndb stuff, and should therefore move to
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after
271 # TODO(wrengr): This is only called by ``CrashAnalysisPipeline.run``; 270 # TODO(wrengr): This is only called by ``CrashAnalysisPipeline.run``;
272 # we should be able to adjust things so that we only need to take in 271 # we should be able to adjust things so that we only need to take in
273 # ``crash_identifiers``, or a CrashReport, rather than taking in the 272 # ``crash_identifiers``, or a CrashReport, rather than taking in the
274 # whole model. And/or, we should just inline this there. 273 # whole model. And/or, we should just inline this there.
275 # TODO(http://crbug.com/659346): coverage tests for this class, not 274 # TODO(http://crbug.com/659346): coverage tests for this class, not
276 # just for FinditForFracas. 275 # just for FinditForFracas.
277 def FindCulprit(self, model): # pragma: no cover 276 def FindCulprit(self, model): # pragma: no cover
278 """Given a CrashAnalysis ndb.Model, return a Culprit.""" 277 """Given a CrashAnalysis ndb.Model, return a Culprit."""
279 stacktrace = self.ParseStacktrace(model) 278 stacktrace = self.ParseStacktrace(model)
280 if stacktrace is None: 279 if stacktrace is None:
281 return Culprit('', [], [], None, None) 280 return None
282 281
283 return self._predator.FindCulprit(CrashReport( 282 return self._predator.FindCulprit(CrashReport(
284 crashed_version = model.crashed_version, 283 crashed_version = model.crashed_version,
285 signature = model.signature, 284 signature = model.signature,
286 platform = model.platform, 285 platform = model.platform,
287 stacktrace = stacktrace, 286 stacktrace = stacktrace,
288 regression_range = model.regression_range)) 287 regression_range = model.regression_range))
OLDNEW
« no previous file with comments | « appengine/findit/crash/culprit.py ('k') | appengine/findit/crash/test/crash_pipeline_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698