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

Side by Side Diff: appengine/findit/util_scripts/crash_queries/delta_test/run-delta-test.py

Issue 2432203003: [Predator] Run predator. (Closed)
Patch Set: Fix flaky BadStatusLine exception. Created 4 years, 1 month 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 """Runs delta test on 2 findit versions.""" 5 """Runs delta test on 2 findit versions."""
6 6
7 import argparse 7 import argparse
8 from datetime import date 8 from datetime import date
9 from datetime import timedelta 9 from datetime import timedelta
10 import pickle 10 import pickle
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 118
119 # If only one revision provided, default the rev2 to HEAD. 119 # If only one revision provided, default the rev2 to HEAD.
120 if len(args.revisions) == 1: 120 if len(args.revisions) == 1:
121 args.revisions.append('HEAD') 121 args.revisions.append('HEAD')
122 122
123 git_hash1 = delta_util.ParseGitHash(args.revisions[0]) 123 git_hash1 = delta_util.ParseGitHash(args.revisions[0])
124 git_hash2 = delta_util.ParseGitHash(args.revisions[1]) 124 git_hash2 = delta_util.ParseGitHash(args.revisions[1])
125 125
126 delta_result_prefix = '%s_%s_%s..%s.delta' % (git_hash1[:7], git_hash2[:7], 126 delta_result_prefix = '%s_%s_%s..%s.delta' % (git_hash1[:7], git_hash2[:7],
127 args.since, args.until) 127 args.since, args.until)
128 delta_csv_path = os.path.join( 128 delta_csv_path = os.path.join(DELTA_RESULTS_DIRECTORY,
129 DELTA_RESULTS_DIRECTORY, '%s.csv' % delta_result_prefix) 129 '%s.csv' % delta_result_prefix)
130 delta_path = os.path.join( 130 delta_path = os.path.join(DELTA_RESULTS_DIRECTORY,
131 DELTA_RESULTS_DIRECTORY, '.%s' % delta_result_prefix) 131 delta_result_prefix)
132 132
133 # Check if delta results already existed. 133 # Check if delta results already existed.
134 if os.path.exists(delta_csv_path): 134 if os.path.exists(delta_csv_path):
135 logging.info('Delta results existed in\n%s', delta_csv_path) 135 print 'Delta results existed in\n%s' % delta_csv_path
136 if not os.path.exists(delta_path): 136 if not os.path.exists(delta_path):
137 logging.info('Cannot print out delta results, ' 137 print 'Cannot print out delta results, please open %s to see the results.'
138 'please open %s to see the results.')
139 return 138 return
140 139
141 with open(delta_path) as f: 140 with open(delta_path) as f:
142 deltas, crash_num = pickle.load(f) 141 deltas, crash_num = pickle.load(f)
143 else: 142 else:
144 logging.info('Running delta test...') 143 print 'Running delta test...'
145 # Get delta of results between git_hash1 and git_hash2. 144 # Get delta of results between git_hash1 and git_hash2.
146 deltas, crash_num = delta_test.DeltaEvaluator( 145 deltas, crash_num = delta_test.DeltaEvaluator(
147 git_hash1, git_hash2, args.client, args.app, 146 git_hash1, git_hash2, args.client, args.app,
148 start_date=args.since, end_date=args.until, 147 start_date=args.since, end_date=args.until,
149 batch_size=args.batch, verbose=args.verbose) 148 batch_size=args.batch, verbose=args.verbose)
150 delta_util.FlushResult([deltas, crash_num], delta_path) 149 delta_util.FlushResult([deltas, crash_num], delta_path)
151 delta_util.WriteDeltaToCSV(deltas, crash_num, 150 delta_util.WriteDeltaToCSV(deltas, crash_num, args.app,
152 git_hash1, git_hash2, delta_csv_path) 151 git_hash1, git_hash2, delta_csv_path)
153 152
154 # Print delta results to users. 153 # Print delta results to users.
155 logging.info('\n========================= Summary =========================') 154 print '\n========================= Summary ========================='
156 delta_util.PrintDelta(deltas, crash_num) 155 delta_util.PrintDelta(deltas, crash_num, args.app)
157 156
158 157
159 if __name__ == '__main__': 158 if __name__ == '__main__':
160 RunDeltaTest() 159 RunDeltaTest()
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698