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