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

Unified Diff: appengine/findit/crash/azalea.py

Issue 2414523002: [Findit] Reorganizing findit_for_*.py (Closed)
Patch Set: Finally fixed the mock tests! 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | appengine/findit/crash/changelist_classifier.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: appengine/findit/crash/azalea.py
diff --git a/appengine/findit/crash/azalea.py b/appengine/findit/crash/azalea.py
new file mode 100644
index 0000000000000000000000000000000000000000..234c0348b5416e4727322d4dfec018eb6b19f41d
--- /dev/null
+++ b/appengine/findit/crash/azalea.py
@@ -0,0 +1,31 @@
+# Copyright 2016 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+from crash.culprit import Culprit
+
+# TODO(http://crbug.com/659346): write coverage tests.
+class Azalea(object): # pragma: no cover
+ """The Main entry point into the Azalea library."""
+
+ def __init__(self, cl_classifier, component_classifier, project_classifier):
+ self.cl_classifier = cl_classifier
+ self.component_classifier = component_classifier
+ self.project_classifier = project_classifier
+
+ def FindCulprit(self, report):
+ """Given a CrashReport, return a Culprit."""
+ suspected_cls = self.cl_classifier(report)
+
+ suspected_project = self.project_classifier.Classify(
+ suspected_cls, report.stacktrace.crash_stack)
+
+ suspected_components = self.component_classifier.Classify(
+ suspected_cls, report.stacktrace.crash_stack)
+
+ return Culprit(
+ project = suspected_project,
+ components = suspected_components,
+ cls = suspected_cls,
+ regression_range = report.regression_range,
+ algorithm = 'core_algorithm')
« no previous file with comments | « no previous file | appengine/findit/crash/changelist_classifier.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698