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

Side by Side Diff: tools/compare_codereview.py

Issue 135683003: Explain empty report in compare_codereview.py. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: reupload Created 6 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 | « 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/python2 1 #!/usr/bin/python2
2 2
3 # Copyright 2014 Google Inc. 3 # Copyright 2014 Google Inc.
4 # 4 #
5 # Use of this source code is governed by a BSD-style license that can be 5 # Use of this source code is governed by a BSD-style license that can be
6 # found in the LICENSE file. 6 # found in the LICENSE file.
7 7
8 """Skia's Chromium Codereview Comparison Script. 8 """Skia's Chromium Codereview Comparison Script.
9 9
10 This script takes two Codereview URLs, looks at the trybot results for 10 This script takes two Codereview URLs, looks at the trybot results for
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after
318 318
319 Args: 319 Args:
320 control_url, roll_url: (strings) URL of the format 320 control_url, roll_url: (strings) URL of the format
321 https://codereview.chromium.org/????????? 321 https://codereview.chromium.org/?????????
322 322
323 verbosity: (int) verbose level. 0, 1, or 2. 323 verbosity: (int) verbose level. 0, 1, or 2.
324 """ 324 """
325 # pylint: disable=I0011,R0914,R0912 325 # pylint: disable=I0011,R0914,R0912
326 control = CodeReviewHTMLParser.parse(control_url) 326 control = CodeReviewHTMLParser.parse(control_url)
327 roll = CodeReviewHTMLParser.parse(roll_url) 327 roll = CodeReviewHTMLParser.parse(roll_url)
328 if not (control and roll): 328 all_bots = set(control) & set(roll) # Set intersection.
329 if not all_bots:
330 print >> sys.stderr, (
331 'Error: control %s and roll %s have no common trybots.'
332 % (list(control), list(roll)))
329 return 333 return
330 334
331 control_name = '[control %s]' % control_url.split('/')[-1] 335 control_name = '[control %s]' % control_url.split('/')[-1]
332 roll_name = '[roll %s]' % roll_url.split('/')[-1] 336 roll_name = '[roll %s]' % roll_url.split('/')[-1]
333 all_bots = set(control) & set(roll) # Set intersection.
334 337
335 out = sys.stdout 338 out = sys.stdout
336 if verbosity > 0: 339 if verbosity > 0:
337 # Print out summary of all of the bots. 340 # Print out summary of all of the bots.
338 out.write('%11s %11s %4s %s\n\n' % 341 out.write('%11s %11s %4s %s\n\n' %
339 ('CONTROL', 'ROLL', 'DIFF', 'BOT')) 342 ('CONTROL', 'ROLL', 'DIFF', 'BOT'))
340 for bot in sorted(all_bots): 343 for bot in sorted(all_bots):
341 if control[bot].status != roll[bot].status: 344 if control[bot].status != roll[bot].status:
342 diff = '****' 345 diff = '****'
343 elif (control[bot].status != 'success' or 346 elif (control[bot].status != 'success' or
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
378 out.write('\n') 381 out.write('\n')
379 382
380 383
381 if __name__ == '__main__': 384 if __name__ == '__main__':
382 if len(sys.argv) < 3: 385 if len(sys.argv) < 3:
383 print >> sys.stderr, __doc__ 386 print >> sys.stderr, __doc__
384 exit(1) 387 exit(1)
385 main(sys.argv[1], sys.argv[2], 388 main(sys.argv[1], sys.argv[2],
386 int(os.environ.get('COMPARE_CODEREVIEW_VERBOSITY', 1))) 389 int(os.environ.get('COMPARE_CODEREVIEW_VERBOSITY', 1)))
387 390
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