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

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