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

Unified Diff: appengine/findit/crash/crash_report.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 | « appengine/findit/crash/crash_pipeline.py ('k') | appengine/findit/crash/culprit.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: appengine/findit/crash/crash_report.py
diff --git a/appengine/findit/crash/crash_report.py b/appengine/findit/crash/crash_report.py
new file mode 100644
index 0000000000000000000000000000000000000000..a332853d1f47b6946c3a0f2a73ede22ca75dfa71
--- /dev/null
+++ b/appengine/findit/crash/crash_report.py
@@ -0,0 +1,45 @@
+# 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.
+
+import logging
+from collections import namedtuple
+
+from crash.stacktrace import Stacktrace
+
+class CrashReport(namedtuple('CrashReport',
+ ['crashed_version', 'signature', 'platform', 'stacktrace',
+ 'regression_range'])):
+ """A reported crash we want to analyze.
+
+ This class comprises the inputs to the Azalea library; as distinguished
+ from the Culprit class, which comprises the outputs/results of Azalea's
+ analyses. N.B., the appengine clients conflate input and output into
+ a single CrashAnalysis(ndb.Model) class, but that's up to them; in
+ the library we keep inputs and outputs entirely distinct.
+
+ Args:
+ crashed_version (str): The version of Chrome in which the crash occurred.
+ signature (str): The signature of the crash on the Chrome crash server.
+ platform (str): The platform name; e.g., 'win', 'mac', 'linux', 'android',
+ 'ios', etc.
+ stacktrace (Stacktrace): The stacktrace of the crash. N.B., this is
+ an object generated by parsing the string containing the stack trace;
+ we do not store the string itself.
+ regression_range : a pair of the last-good and first-bad
+ versions. N.B., because this is an input, it is up to clients
+ to call DetectRegressionRange (or whatever else) in order to
+ provide this information.
+ """
+ __slots__ = ()
+
+ def __new__(cls, crashed_version, signature, platform, stacktrace,
+ regression_range):
+ # TODO: should raise a TypeError rather than an AssertionError
+ assert isinstance(stacktrace, Stacktrace), (
+ 'In the fourth argument to CrashReport constructor, '
+ 'expected Stacktrace object, but got %s object instead.'
+ % stacktrace.__class__.__name__)
+
+ return super(cls, CrashReport).__new__(cls,
+ crashed_version, signature, platform, stacktrace, regression_range)
« no previous file with comments | « appengine/findit/crash/crash_pipeline.py ('k') | appengine/findit/crash/culprit.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698