| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
| 5 | 5 |
| 6 """A tool to archive layout test results generated by buildbots. | 6 """A tool to archive layout test results generated by buildbots. |
| 7 | 7 |
| 8 Actual result files (*-actual.txt), but not results from simplified diff | 8 Actual result files (*-actual.txt), but not results from simplified diff |
| 9 tests (*-simp-actual.txt) or JS-filtered diff tests (*-jsfilt.txt), will | 9 tests (*-simp-actual.txt) or JS-filtered diff tests (*-jsfilt.txt), will |
| 10 be included in the archive. | 10 be included in the archive. |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 | 24 |
| 25 import logging | 25 import logging |
| 26 import optparse | 26 import optparse |
| 27 import os | 27 import os |
| 28 import re | 28 import re |
| 29 import socket | 29 import socket |
| 30 import sys | 30 import sys |
| 31 | 31 |
| 32 from common import archive_utils | 32 from common import archive_utils |
| 33 from common import chromium_utils | 33 from common import chromium_utils |
| 34 from slave import build_directory | |
| 35 from slave import slave_utils | 34 from slave import slave_utils |
| 36 | 35 |
| 37 # Directory name, above the build directory, in which test results can be | 36 # Directory name, above the build directory, in which test results can be |
| 38 # found if no --results-dir option is given. | 37 # found if no --results-dir option is given. |
| 39 RESULT_DIR = 'layout-test-results' | 38 RESULT_DIR = 'layout-test-results' |
| 40 | 39 |
| 41 | 40 |
| 42 def _CollectArchiveFiles(output_dir): | 41 def _CollectArchiveFiles(output_dir): |
| 43 """Returns a pair of lists of file paths to archive. | 42 """Returns a pair of lists of file paths to archive. |
| 44 | 43 |
| (...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 254 _CopyFileToArchiveHost(full_results_json, dest_dir) | 253 _CopyFileToArchiveHost(full_results_json, dest_dir) |
| 255 _CopyFileToArchiveHost(failing_results_json, dest_dir) | 254 _CopyFileToArchiveHost(failing_results_json, dest_dir) |
| 256 # Not supported on Google Storage yet. | 255 # Not supported on Google Storage yet. |
| 257 _ArchiveFullLayoutTestResults(staging_dir, dest_parent_dir, diff_file_list, | 256 _ArchiveFullLayoutTestResults(staging_dir, dest_parent_dir, diff_file_list, |
| 258 options) | 257 options) |
| 259 return 0 | 258 return 0 |
| 260 | 259 |
| 261 | 260 |
| 262 def _ParseOptions(): | 261 def _ParseOptions(): |
| 263 option_parser = optparse.OptionParser() | 262 option_parser = optparse.OptionParser() |
| 264 option_parser.add_option('', '--build-dir', help='ignored') | 263 option_parser.add_option('', '--build-dir', |
| 264 help='Build dir path, relative to checkout root.') |
| 265 option_parser.add_option('', '--results-dir', | 265 option_parser.add_option('', '--results-dir', |
| 266 help='path to layout test results, relative to ' | 266 help='path to layout test results, relative to ' |
| 267 'the build_dir') | 267 'the build_dir') |
| 268 option_parser.add_option('', '--builder-name', | 268 option_parser.add_option('', '--builder-name', |
| 269 default=None, | 269 default=None, |
| 270 help='The name of the builder running this script.') | 270 help='The name of the builder running this script.') |
| 271 option_parser.add_option('', '--build-number', | 271 option_parser.add_option('', '--build-number', |
| 272 default=None, | 272 default=None, |
| 273 help=('The build number of the builder running' | 273 help=('The build number of the builder running' |
| 274 'this script.')) | 274 'this script.')) |
| 275 option_parser.add_option('', '--gs-bucket', | 275 option_parser.add_option('', '--gs-bucket', |
| 276 default=None, | 276 default=None, |
| 277 help=('The google storage bucket to upload to. ' | 277 help=('The google storage bucket to upload to. ' |
| 278 'If provided, this script will upload to gs ' | 278 'If provided, this script will upload to gs ' |
| 279 'instead of the master.')) | 279 'instead of the master.')) |
| 280 option_parser.add_option('', '--gs-acl', | 280 option_parser.add_option('', '--gs-acl', |
| 281 default=None, | 281 default=None, |
| 282 help=('The ACL of the google storage files.')) | 282 help=('The ACL of the google storage files.')) |
| 283 option_parser.add_option('--staging-dir', | 283 option_parser.add_option('--staging-dir', |
| 284 help='Directory to use for staging the archives. ' | 284 help='Directory to use for staging the archives. ' |
| 285 'Default behavior is to automatically detect ' | 285 'Default behavior is to automatically detect ' |
| 286 'slave\'s build directory.') | 286 'slave\'s build directory.') |
| 287 chromium_utils.AddPropertiesOptions(option_parser) | 287 chromium_utils.AddPropertiesOptions(option_parser) |
| 288 options, _ = option_parser.parse_args() | 288 options, _ = option_parser.parse_args() |
| 289 options.build_dir = build_directory.GetBuildOutputDirectory() | |
| 290 return options | 289 return options |
| 291 | 290 |
| 292 | 291 |
| 293 def main(): | 292 def main(): |
| 294 options = _ParseOptions() | 293 options = _ParseOptions() |
| 295 logging.basicConfig(level=logging.INFO, | 294 logging.basicConfig(level=logging.INFO, |
| 296 format='%(asctime)s %(filename)s:%(lineno)-3d' | 295 format='%(asctime)s %(filename)s:%(lineno)-3d' |
| 297 ' %(levelname)s %(message)s', | 296 ' %(levelname)s %(message)s', |
| 298 datefmt='%y%m%d %H:%M:%S') | 297 datefmt='%y%m%d %H:%M:%S') |
| 299 return archive_layout(options) | 298 return archive_layout(options) |
| 300 | 299 |
| 301 | 300 |
| 302 if '__main__' == __name__: | 301 if '__main__' == __name__: |
| 303 sys.exit(main()) | 302 sys.exit(main()) |
| OLD | NEW |