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

Side by Side 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: 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 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 6
7 from google.appengine.api import users 7 from google.appengine.api import users
8 8
9 from common.change_log import ChangeLog
9 from common.findit_testcase import FinditTestCase 10 from common.findit_testcase import FinditTestCase
10 from model.crash.crash_config import CrashConfig 11 from model.crash.crash_config import CrashConfig
11 12
12 13
13 DEFAULT_CONFIG_DATA = { 14 DEFAULT_CONFIG_DATA = {
14 'fracas': { 15 'fracas': {
15 'analysis_result_pubsub_topic': 'projects/project-name/topics/name', 16 'analysis_result_pubsub_topic': 'projects/project-name/topics/name',
16 'supported_platform_list_by_channel': { 17 'supported_platform_list_by_channel': {
17 'canary': ['win', 'mac'], 18 'canary': ['win', 'mac'],
18 'supported_channel': ['supported_platform'], 19 'supported_channel': ['supported_platform'],
19 }, 20 },
21 },
22 'component_classifier': {
23 "path_function_component": [
24 [
25 "src/comp1.*",
26 "",
27 "Comp1>Dummy"
28 ],
29 [
30 "src/comp2.*",
31 "func2.*",
32 "Comp2>Dummy"
33 ],
34 ],
35 "top_n": "4"
36 },
37 'project_classifier': {
38 "file_path_marker_to_project_name": {
39 "googleplex-android/": "android_os",
40 },
41 "function_marker_to_project_name": {
42 "org.chromium": "chromium",
43 "android.": "android_os",
44 },
45 "host_directories": [
46 "src/"
47 ],
48 "non_chromium_project_rank_priority": {
49 "android_os": "-1",
50 "others": "-2",
51 },
52 "top_n": "4"
20 } 53 }
21 } 54 }
22 55
56 DUMMY_CHANGELOG = ChangeLog.FromDict({
57 'author_name': 'r@chromium.org',
58 'message': 'dummy',
59 'committer_email': 'r@chromium.org',
60 'commit_position': 175900,
61 'author_email': 'r@chromium.org',
62 'touched_files': [
63 {
64 'change_type': 'add',
65 'new_path': 'a.cc',
66 'old_path': None,
67 },
68 ],
69 'author_time': 'Thu Mar 31 21:24:43 2016',
70 'committer_time': 'Thu Mar 31 21:28:39 2016',
71 'commit_url':
72 'https://repo.test/+/1',
73 'code_review_url': 'https://codereview.chromium.org/3281',
74 'committer_name': 'example@chromium.org',
75 'revision': '1',
76 'reverted_revision': None
77 })
78
79
23 class CrashTestCase(FinditTestCase): # pragma: no cover. 80 class CrashTestCase(FinditTestCase): # pragma: no cover.
24 81
25 def setUp(self): 82 def setUp(self):
26 super(CrashTestCase, self).setUp() 83 super(CrashTestCase, self).setUp()
27 CrashConfig.Get().Update( 84 CrashConfig.Get().Update(
28 users.User(email='admin@chromium.org'), True, **DEFAULT_CONFIG_DATA) 85 users.User(email='admin@chromium.org'), True, **DEFAULT_CONFIG_DATA)
29 86
30 87 def GetDummyChangeLog(self):
88 return DUMMY_CHANGELOG
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698