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

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

Issue 2457153002: replacing the NullCulprit class by None (Closed)
Patch Set: 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
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 NullCulprit
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 244 matching lines...) Expand 10 before | Expand all | Expand 10 after
270 # TODO(wrengr): This is only called by |CrashAnalysisPipeline.run|; 269 # TODO(wrengr): This is only called by |CrashAnalysisPipeline.run|;
271 # we should be able to adjust things so that we only need to take in 270 # we should be able to adjust things so that we only need to take in
272 # |crash_identifiers|, or a CrashReport, rather than taking in the 271 # |crash_identifiers|, or a CrashReport, rather than taking in the
273 # whole model. And/or, we should just inline this there. 272 # whole model. And/or, we should just inline this there.
274 # TODO(http://crbug.com/659346): coverage tests for this class, not 273 # TODO(http://crbug.com/659346): coverage tests for this class, not
275 # just for FinditForFracas. 274 # just for FinditForFracas.
276 def FindCulprit(self, model): # pragma: no cover 275 def FindCulprit(self, model): # pragma: no cover
277 """Given a CrashAnalysis ndb.Model, return a Culprit.""" 276 """Given a CrashAnalysis ndb.Model, return a Culprit."""
278 stacktrace = self.ParseStacktrace(model) 277 stacktrace = self.ParseStacktrace(model)
279 if stacktrace is None: 278 if stacktrace is None:
280 # TODO(http://crbug.com/659359): refactor things so we don't need 279 return None
Sharu Jiang 2016/10/28 20:34:12 It's ok to return None here, but you need to updat
wrengr 2016/10/28 21:11:19 Indeed, the goal of this CL is to allow returning
Sharu Jiang 2016/10/28 23:40:58 Yes, the algorithm is a better name, however when
281 # the NullCulprit class.
282 return NullCulprit()
283 280
284 return self._azalea.FindCulprit(CrashReport( 281 return self._azalea.FindCulprit(CrashReport(
285 crashed_version = model.crashed_version, 282 crashed_version = model.crashed_version,
286 signature = model.signature, 283 signature = model.signature,
287 platform = model.platform, 284 platform = model.platform,
288 stacktrace = stacktrace, 285 stacktrace = stacktrace,
289 regression_range = model.regression_range)) 286 regression_range = model.regression_range))
OLDNEW
« no previous file with comments | « appengine/findit/crash/culprit.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