| OLD | NEW |
| 1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 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 """This file contains printing-related functionality of the bisect.""" | 5 """This file contains printing-related functionality of the bisect.""" |
| 6 | 6 |
| 7 import datetime | 7 import datetime |
| 8 import re | 8 import re |
| 9 | 9 |
| 10 from bisect_results import BisectResults | 10 from bisect_results import BisectResults |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 REPRO_STEPS_LOCAL = """ | 57 REPRO_STEPS_LOCAL = """ |
| 58 ==== INSTRUCTIONS TO REPRODUCE ==== | 58 ==== INSTRUCTIONS TO REPRODUCE ==== |
| 59 To run locally: | 59 To run locally: |
| 60 - Use the test command given under 'BISECT JOB RESULTS' above. | 60 - Use the test command given under 'BISECT JOB RESULTS' above. |
| 61 - Consider using a profiler. Pass --profiler=list to list available profilers. | 61 - Consider using a profiler. Pass --profiler=list to list available profilers. |
| 62 """ | 62 """ |
| 63 | 63 |
| 64 REPRO_STEPS_TRYJOB = """ | 64 REPRO_STEPS_TRYJOB = """ |
| 65 To reproduce on a performance try bot: | 65 To reproduce on a performance try bot: |
| 66 1. Edit run-perf-test.cfg | 66 1. Edit run-perf-test.cfg |
| 67 2. $ git try -b <bot> --svn_repo='svn://svn.chromium.org/chrome-try/try-perf' | 67 2. git try -b bot-name --svn_repo='svn://svn.chromium.org/chrome-try/try-perf' |
| 68 | 68 |
| 69 Notes: | 69 Notes: |
| 70 a) Follow the in-file instructions in run-perf-test.cfg. | 70 a) Follow the in-file instructions in run-perf-test.cfg. |
| 71 b) run-perf-test.cfg is under tools/ or under third_party/WebKit/Tools. | 71 b) run-perf-test.cfg is under tools/ or under third_party/WebKit/Tools. |
| 72 c) Do your edits preferably under a new git branch. | 72 c) Do your edits preferably under a new git branch. |
| 73 d) --browser=release and --browser=android-chromium-testshell are supported | 73 d) --browser=release and --browser=android-chromium-testshell are supported |
| 74 depending on the platform (desktop|android). | 74 depending on the platform (desktop|android). |
| 75 e) Strip any src/ directories from the head of relative path names. | 75 e) Strip any src/ directories from the head of relative path names. |
| 76 f) Make sure to use the appropriate bot on step 3. | 76 f) Make sure to use the appropriate bot on step 3. |
| 77 | 77 |
| 78 For more details please visit | 78 For more details please visit |
| 79 https://sites.google.com/a/chromium.org/dev/developers/performance-try-bots""" | 79 https://sites.google.com/a/chromium.org/dev/developers/performance-try-bots""" |
| 80 | 80 |
| 81 REPRO_STEPS_TRYJOB_TELEMETRY = """ | 81 REPRO_STEPS_TRYJOB_TELEMETRY = """ |
| 82 To reproduce on a performance try bot: | 82 To reproduce on a performance try bot: |
| 83 %(command)s | 83 %(command)s |
| 84 (Where <bot-name> comes from tools/perf/run_benchmark --browser=list) | 84 (Where bot-name comes from tools/perf/run_benchmark --browser=list) |
| 85 | 85 |
| 86 For more details please visit | 86 For more details please visit |
| 87 https://sites.google.com/a/chromium.org/dev/developers/performance-try-bots | 87 https://sites.google.com/a/chromium.org/dev/developers/performance-try-bots |
| 88 """ | 88 """ |
| 89 | 89 |
| 90 | 90 |
| 91 class BisectPrinter(object): | 91 class BisectPrinter(object): |
| 92 | 92 |
| 93 def __init__(self, opts, depot_registry): | 93 def __init__(self, opts, depot_registry): |
| 94 self.opts = opts | 94 self.opts = opts |
| (...skipping 18 matching lines...) Expand all Loading... |
| 113 print 'Full results of bisection:' | 113 print 'Full results of bisection:' |
| 114 for revision_state in bisect_results.state.GetRevisionStates(): | 114 for revision_state in bisect_results.state.GetRevisionStates(): |
| 115 build_status = revision_state.passed | 115 build_status = revision_state.passed |
| 116 | 116 |
| 117 if type(build_status) is bool: | 117 if type(build_status) is bool: |
| 118 if build_status: | 118 if build_status: |
| 119 build_status = 'Good' | 119 build_status = 'Good' |
| 120 else: | 120 else: |
| 121 build_status = 'Bad' | 121 build_status = 'Bad' |
| 122 | 122 |
| 123 print ' %20s %40s %s' % (revision_state.depot, revision_state.revision, | 123 print ' %20s %40s %s' % (revision_state.depot, |
| 124 revision_state.revision, |
| 124 build_status) | 125 build_status) |
| 125 print | 126 print |
| 126 | 127 |
| 127 if self.opts.output_buildbot_annotations: | 128 if self.opts.output_buildbot_annotations: |
| 128 bisect_utils.OutputAnnotationStepClosed() | 129 bisect_utils.OutputAnnotationStepClosed() |
| 129 # The perf dashboard scrapes the "results" step in order to comment on | 130 # The perf dashboard scrapes the "results" step in order to comment on |
| 130 # bugs. If you change this, please update the perf dashboard as well. | 131 # bugs. If you change this, please update the perf dashboard as well. |
| 131 bisect_utils.OutputAnnotationStepStart('Results') | 132 bisect_utils.OutputAnnotationStepStart('Results') |
| 132 | 133 |
| 133 self._PrintBanner(bisect_results) | 134 self._PrintBanner(bisect_results) |
| (...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 336 | 337 |
| 337 This message includes the command used to run the test. | 338 This message includes the command used to run the test. |
| 338 """ | 339 """ |
| 339 command = '$ ' + self.opts.command | 340 command = '$ ' + self.opts.command |
| 340 if bisect_utils.IsTelemetryCommand(self.opts.command): | 341 if bisect_utils.IsTelemetryCommand(self.opts.command): |
| 341 command += ('\nAlso consider passing --profiler=list to see available ' | 342 command += ('\nAlso consider passing --profiler=list to see available ' |
| 342 'profilers.') | 343 'profilers.') |
| 343 print REPRO_STEPS_LOCAL | 344 print REPRO_STEPS_LOCAL |
| 344 if bisect_utils.IsTelemetryCommand(self.opts.command): | 345 if bisect_utils.IsTelemetryCommand(self.opts.command): |
| 345 telemetry_command = re.sub(r'--browser=[^\s]+', | 346 telemetry_command = re.sub(r'--browser=[^\s]+', |
| 346 '--browser=<bot-name>', | 347 '--browser=bot-name', |
| 347 command) | 348 command) |
| 348 print REPRO_STEPS_TRYJOB_TELEMETRY % {'command': telemetry_command} | 349 print REPRO_STEPS_TRYJOB_TELEMETRY % {'command': telemetry_command} |
| 349 else: | 350 else: |
| 350 print REPRO_STEPS_TRYJOB | 351 print REPRO_STEPS_TRYJOB |
| 351 | 352 |
| 352 def _PrintOtherRegressions(self, other_regressions): | 353 def _PrintOtherRegressions(self, other_regressions): |
| 353 """Prints a section of the results about other potential regressions.""" | 354 """Prints a section of the results about other potential regressions.""" |
| 354 print | 355 print |
| 355 print 'Other regressions may have occurred:' | 356 print 'Other regressions may have occurred:' |
| 356 self._PrintTableRow([8, 70, 10], ['Depot', 'Range', 'Confidence']) | 357 self._PrintTableRow([8, 70, 10], ['Depot', 'Range', 'Confidence']) |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 406 | 407 |
| 407 @staticmethod | 408 @staticmethod |
| 408 def _PrintWarnings(warnings): | 409 def _PrintWarnings(warnings): |
| 409 """Prints a list of warning strings if there are any.""" | 410 """Prints a list of warning strings if there are any.""" |
| 410 if not warnings: | 411 if not warnings: |
| 411 return | 412 return |
| 412 print | 413 print |
| 413 print 'WARNINGS:' | 414 print 'WARNINGS:' |
| 414 for w in set(warnings): | 415 for w in set(warnings): |
| 415 print ' ! %s' % w | 416 print ' ! %s' % w |
| OLD | NEW |