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

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 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..2a7bb61135d525881cf14c1b06d3396e301be5d2 100644
--- a/appengine/findit/crash/test/crash_testcase.py
+++ b/appengine/findit/crash/test/crash_testcase.py
@@ -3,9 +3,11 @@
# found in the LICENSE file.
import copy
+import re
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 +19,65 @@ DEFAULT_CONFIG_DATA = {
'canary': ['win', 'mac', 'linux'],
'supported_channel': ['supported_platform'],
},
+ },
+ 'component_classifier': {
+ "path_function_component": [
+ [
+ "src/comp1.*",
+ "",
+ "Comp1>Dummy"
+ ],
+ [
+ "src/comp2.*",
+ "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 +85,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
« no previous file with comments | « appengine/findit/crash/test/crash_test_suite.py ('k') | appengine/findit/crash/test/findit_for_crash_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698