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

Side by Side Diff: tools/gen_bench_expectations_from_codereview.py

Issue 304943002: Bench rebaseline from codereview: fix is_finished (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: remove pritn Created 6 years, 6 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 | « no previous file | 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 #!/usr/bin/python 1 #!/usr/bin/python
2 2
3 # Copyright (c) 2014 The Chromium Authors. All rights reserved. 3 # Copyright (c) 2014 The Chromium Authors. All rights reserved.
4 # Use of this source code is governed by a BSD-style license that can be 4 # Use of this source code is governed by a BSD-style license that can be
5 # found in the LICENSE file. 5 # found in the LICENSE file.
6 6
7 7
8 """Generate new bench expectations from results of trybots on a code review.""" 8 """Generate new bench expectations from results of trybots on a code review."""
9 9
10 10
(...skipping 23 matching lines...) Expand all
34 codereview_url: URL of the codereview in question. 34 codereview_url: URL of the codereview in question.
35 35
36 Returns: 36 Returns:
37 List of NamedTuples: (builder_name, build_number, is_finished) 37 List of NamedTuples: (builder_name, build_number, is_finished)
38 """ 38 """
39 results = compare_codereview.CodeReviewHTMLParser().parse(codereview_url) 39 results = compare_codereview.CodeReviewHTMLParser().parse(codereview_url)
40 try_builds = [] 40 try_builds = []
41 for builder, data in results.iteritems(): 41 for builder, data in results.iteritems():
42 if builder.startswith('Perf'): 42 if builder.startswith('Perf'):
43 build_num = data.url.split('/')[-1] if data.url else None 43 build_num = data.url.split('/')[-1] if data.url else None
44 try_builds.append(TryBuild(builder, build_num, 44 is_finished = (data.status not in ('pending', 'try-pending') and
45 data.status != 'pending')) 45 build_num is not None)
46 try_builds.append(TryBuild(builder_name=builder,
47 build_number=build_num,
48 is_finished=is_finished))
46 return try_builds 49 return try_builds
47 50
48 51
49 def _all_trybots_finished(try_builds): 52 def _all_trybots_finished(try_builds):
50 """Return True iff all of the given try jobs have finished. 53 """Return True iff all of the given try jobs have finished.
51 54
52 Args: 55 Args:
53 try_builds: list of TryBuild instances. 56 try_builds: list of TryBuild instances.
54 57
55 Returns: 58 Returns:
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
171 if failed_gen_expectations: 174 if failed_gen_expectations:
172 failure += 'Failed to generate expectations for: %s\n\n' % ','.join( 175 failure += 'Failed to generate expectations for: %s\n\n' % ','.join(
173 failed_gen_expectations) 176 failed_gen_expectations)
174 if failure: 177 if failure:
175 raise Exception(failure) 178 raise Exception(failure)
176 179
177 180
178 if __name__ == '__main__': 181 if __name__ == '__main__':
179 gen_bench_expectations_from_codereview(sys.argv[1]) 182 gen_bench_expectations_from_codereview(sys.argv[1])
180 183
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698