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

Side by Side Diff: appengine/findit/util_scripts/crash_queries/delta_test/delta_test.py

Issue 2607813002: [Predator] Make ``CallStackDetector`` return a namedtuple. (Closed)
Patch Set: Rebase and fix nit. Created 3 years, 11 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
« no previous file with comments | « appengine/findit/crash/test/stacktrace_test.py ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 json 5 import json
6 import os 6 import os
7 import pickle 7 import pickle
8 import subprocess 8 import subprocess
9 9
10 from crash_queries import crash_iterator 10 from crash_queries import crash_iterator
11 from crash_queries.delta_test import delta_util 11 from crash_queries.delta_test import delta_util
12 12
13 PREDATOR_RESULTS_DIRECTORY = os.path.join(os.path.dirname(__file__), 13 PREDATOR_RESULTS_DIRECTORY = os.path.join(os.path.dirname(__file__),
14 'predator_results') 14 'predator_results')
15 DELTA_TEST_DIRECTORY = os.path.dirname(__file__) 15 DELTA_TEST_DIRECTORY = os.path.dirname(__file__)
16 CRASH_FIELDS = ['crashed_version', 'stack_trace', 'signature', 16 CRASH_FIELDS = ['crashed_version', 'stack_trace', 'signature',
17 'platform', 'client_id', 'regression_range', 17 'platform', 'client_id', 'regression_range',
18 'customized_data', 'historical_metadata'] 18 'customized_data', 'historical_metadata']
19 19
20 20
21
22 # TODO(crbug.com/662540): Add unittests. 21 # TODO(crbug.com/662540): Add unittests.
23 class Delta(object): # pragma: no cover. 22 class Delta(object): # pragma: no cover.
24 """Stands for delta between two results. 23 """Stands for delta between two results.
25 24
26 Note, the 2 results should be the same kind and have the same structure. 25 Note, the 2 results should be the same kind and have the same structure.
27 """ 26 """
28 27
29 def __init__(self, result1, result2): 28 def __init__(self, result1, result2):
30 self._result1 = result1 29 self._result1 = result1
31 self._result2 = result2 30 self._result2 = result2
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after
233 print '========= Delta of this batch =========' 232 print '========= Delta of this batch ========='
234 delta_util.PrintDelta(batch_deltas, len(crashes), app_id) 233 delta_util.PrintDelta(batch_deltas, len(crashes), app_id)
235 deltas.update(batch_deltas) 234 deltas.update(batch_deltas)
236 235
237 return deltas, crash_count 236 return deltas, crash_count
238 finally: 237 finally:
239 with open(os.devnull, 'w') as null_handle: 238 with open(os.devnull, 'w') as null_handle:
240 subprocess.check_call(['git', 'checkout', head_branch_name], 239 subprocess.check_call(['git', 'checkout', head_branch_name],
241 stdout=null_handle, 240 stdout=null_handle,
242 stderr=null_handle) 241 stderr=null_handle)
OLDNEW
« no previous file with comments | « appengine/findit/crash/test/stacktrace_test.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698