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

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

Issue 2704843002: [Predator] Add TouchCrashedDirectory feature. (Closed)
Patch Set: . Created 3 years, 10 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/predator_testcase.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 """Util functions for git repository processing for delta test.""" 5 """Util functions for git repository processing for delta test."""
6 6
7 import base64 7 import base64
8 import hashlib 8 import hashlib
9 import json 9 import json
10 import logging 10 import logging
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 EnsureDirExists(file_path) 93 EnsureDirExists(file_path)
94 def _EncodeStr(string): 94 def _EncodeStr(string):
95 return string.replace('\"', '\'') if string else '' 95 return string.replace('\"', '\'') if string else ''
96 96
97 print 'Writing delta diff to %s\n' % file_path 97 print 'Writing delta diff to %s\n' % file_path
98 with open(file_path, 'wb') as f: 98 with open(file_path, 'wb') as f:
99 f.write('Delta between githash1 %s and githash2 %s on %d crashes\n\n' % ( 99 f.write('Delta between githash1 %s and githash2 %s on %d crashes\n\n' % (
100 git_hash1, git_hash2, crash_num)) 100 git_hash1, git_hash2, crash_num))
101 f.write('crash url, project, components, cls, regression_range\n') 101 f.write('crash url, project, components, cls, regression_range\n')
102 for crash_id, delta in deltas.iteritems(): 102 for crash_id, delta in deltas.iteritems():
103 delta_str_dict = delta.delta_str_dict 103 delta_dict_str = delta.delta_dict_str
104 feedback_url = _FRACAS_FEEDBACK_URL_TEMPLATE % (app_id, crash_id) 104 feedback_url = _FRACAS_FEEDBACK_URL_TEMPLATE % (app_id, crash_id)
105 f.write('%s, "%s", "%s", "%s", "%s"\n' % ( 105 f.write('%s, "%s", "%s", "%s", "%s"\n' % (
106 feedback_url, 106 feedback_url,
107 _EncodeStr(delta_str_dict.get('suspected_project', '')), 107 _EncodeStr(delta_dict_str.get('suspected_project', '')),
108 _EncodeStr(delta_str_dict.get('suspected_components', '')), 108 _EncodeStr(delta_dict_str.get('suspected_components', '')),
109 _EncodeStr(delta_str_dict.get('suspected_cls', '')), 109 _EncodeStr(delta_dict_str.get('suspected_cls', '')),
110 _EncodeStr(delta_str_dict.get('regression_range', '')) 110 _EncodeStr(delta_dict_str.get('regression_range', ''))
111 )) 111 ))
OLDNEW
« no previous file with comments | « appengine/findit/crash/test/predator_testcase.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698