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

Unified Diff: appengine/findit/crash/test/crash_testcase.py

Issue 1914113002: [Findit] Enable project classifier and component classifier (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: Rebase and address comments. Created 4 years, 7 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
Index: appengine/findit/crash/test/crash_testcase.py
diff --git a/appengine/findit/crash/test/crash_testcase.py b/appengine/findit/crash/test/crash_testcase.py
index d26231a7624019a5e48405f7eb98b34f49f1a2c4..f8136016e07dc705573e53c8ff9c44a6f1ce0813 100644
--- a/appengine/findit/crash/test/crash_testcase.py
+++ b/appengine/findit/crash/test/crash_testcase.py
@@ -3,9 +3,13 @@
# found in the LICENSE file.
import copy
+import re
+import pickle
+import zlib
from google.appengine.api import users
+from common.change_log import ChangeLog
from common.findit_testcase import FinditTestCase
from model.crash.crash_config import CrashConfig
@@ -17,9 +21,65 @@ DEFAULT_CONFIG_DATA = {
'canary': ['win', 'mac', 'linux'],
'supported_channel': ['supported_platform'],
},
+ },
+ 'compressed_component_classifier': zlib.compress(pickle.dumps({
+ "path_function_component": [
+ [
+ re.compile("src/comp1.*"),
stgao 2016/05/21 00:54:03 This is an interesting idea. If they are compiled
Sharu Jiang 2016/05/23 23:54:50 I think we should still display them as strings an
+ None,
+ "Comp1>Dummy"
+ ],
+ [
+ re.compile("src/comp2.*"),
+ re.compile("func2.*"),
+ "Comp2>Dummy"
+ ],
+ ],
+ "top_n": 4
+ })),
+ 'project_classifier': {
+ "file_path_marker_to_project_name": {
+ "googleplex-android/": "android_os",
+ },
+ "function_marker_to_project_name": {
+ "org.chromium": "chromium",
+ "android.": "android_os",
+ },
+ "host_directories": [
+ "src/"
+ ],
+ "non_chromium_project_rank_priority": {
+ "android_os": "-1",
+ "others": "-2",
+ },
+ "top_n": 4
}
}
+DUMMY_CHANGELOG = ChangeLog.FromDict({
+ 'author_name': 'r@chromium.org',
+ 'message': 'dummy',
+ 'committer_email': 'r@chromium.org',
+ 'commit_position': 175900,
+ 'author_email': 'r@chromium.org',
+ 'touched_files': [
+ {
+ 'change_type': 'add',
+ 'new_path': 'a.cc',
+ 'old_path': None,
+ },
+ ],
+ 'author_time': 'Thu Mar 31 21:24:43 2016',
+ 'committer_time': 'Thu Mar 31 21:28:39 2016',
+ 'commit_url':
+ 'https://repo.test/+/1',
+ 'code_review_url': 'https://codereview.chromium.org/3281',
+ 'committer_name': 'example@chromium.org',
+ 'revision': '1',
+ 'reverted_revision': None
+})
+
+
class CrashTestCase(FinditTestCase): # pragma: no cover.
def setUp(self):
@@ -27,4 +87,5 @@ class CrashTestCase(FinditTestCase): # pragma: no cover.
CrashConfig.Get().Update(
users.User(email='admin@chromium.org'), True, **DEFAULT_CONFIG_DATA)
-
+ def GetDummyChangeLog(self):
+ return DUMMY_CHANGELOG

Powered by Google App Engine
This is Rietveld 408576698