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

Side by Side Diff: appengine/findit/crash/test/crash_test_suite.py

Issue 1861373003: [Findit] Initial code of findit for crash. Add scorers to apply heuristic rules. (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: Fix nits and rebase Created 4 years, 8 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
(Empty)
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
3 # found in the LICENSE file.
4
5 from testing_utils import testing
6 from crash.test.stacktrace_test_suite import StacktraceTestSuite
7
8
9 class CrashTestSuite(StacktraceTestSuite): # pragma: no cover.
10
11 def _VerifyTwoStackInfosEqual(self, infos1, infos2):
12 self.assertEqual(len(infos1), len(infos2))
13
14 for (frame1, priority1), (frame2, priority2) in zip(infos1, infos2):
15 self.assertEqual(priority1, priority2)
16 self._VerifyTwoStackFramesEqual(frame1, frame2)
17
18 def _VerifyTwoBlamesEqual(self, blame1, blame2):
19 self.assertEqual(blame1.revision, blame2.revision)
20 self.assertEqual(blame1.path, blame2.path)
21 map(self.assertEqual, blame1.ToDict()['regions'],
22 blame2.ToDict()['regions'])
23
24 def _VerifyTwoChangeLogsEqual(self, changelog1, changelog2):
25 self.assertEqual(changelog1.ToDict(), changelog2.ToDict())
26
27 def _VerifyTwoResultEqual(self, result1, result2):
28 self._VerifyTwoChangeLogsEqual(result1.changelog, result2.changelog)
29 self.assertEqual(result1.dep_path, result2.dep_path)
30 self.assertEqual(result1.component, result2.component)
31 self.assertEqual(result1.confidence, result2.confidence)
32 self.assertEqual(result1.reason, result2.reason)
33 self.assertEqual(len(result1.file_to_stack_infos),
34 len(result2.file_to_stack_infos))
35
36 for (file_path1, stack_infos1), (file_path2, stack_infos2) in zip(
37 result1.file_to_stack_infos.iteritems(),
38 result2.file_to_stack_infos.iteritems()):
39 self.assertEqual(file_path1, file_path2)
40 self._VerifyTwoStackInfosEqual(stack_infos1, stack_infos2)
41
42 def _VerifyTwoMatchResultEqual(self, match_result1, match_result2):
43 self.assertEqual(match_result1.min_distance, match_result2.min_distance)
44 self._VerifyTwoResultEqual(match_result1, match_result2)
45
46 def _VerifyTwoMatchResultsEqual(self, match_results1, match_results2):
47 self.assertEqual(match_results1.ignore_cls, match_results2.ignore_cls)
48
49 self.assertEqual(len(match_results1), len(match_results2))
50 for revision1, match_result1 in match_results1.iteritems():
51 self.assertTrue(revision1 in match_results2)
52 self._VerifyTwoMatchResultEqual(match_result1, match_results2[revision1])
OLDNEW
« no previous file with comments | « appengine/findit/crash/scorers/top_frame_index.py ('k') | appengine/findit/crash/test/crash_util_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698