Chromium Code Reviews| 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 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 137 print 'last change: %s' % last_change | 137 print 'last change: %s' % last_change |
| 138 print 'build name: %s' % build_name | 138 print 'build name: %s' % build_name |
| 139 print 'build number: %s' % build_number | 139 print 'build number: %s' % build_number |
| 140 print 'host name: %s' % socket.gethostname() | 140 print 'host name: %s' % socket.gethostname() |
| 141 | 141 |
| 142 # Where to save layout test results. | 142 # Where to save layout test results. |
| 143 dest_parent_dir = os.path.join(config.Archive.www_dir_base, | 143 dest_parent_dir = os.path.join(config.Archive.www_dir_base, |
| 144 results_dir_basename.replace('-','_'), build_name) | 144 results_dir_basename.replace('-','_'), build_name) |
| 145 dest_dir = os.path.join(dest_parent_dir, last_change) | 145 dest_dir = os.path.join(dest_parent_dir, last_change) |
| 146 | 146 |
| 147 gs_bucket = options.factory_properties.get('gs_bucket', None) | 147 if options.gs_bucket: |
| 148 if gs_bucket: | 148 gs_base = '/'.join([options.gs_bucket, build_name, build_number]) |
| 149 gs_base = '/'.join([gs_bucket, build_name, build_number]) | 149 gs_acl = options.gs_acl |
|
Dirk Pranke
2013/08/06 21:40:03
Do we actually need gs_acl ? I don't think we're c
| |
| 150 gs_acl = options.factory_properties.get('gs_acl', None) | |
| 151 slave_utils.GSUtilCopyFile(zip_file, gs_base, gs_acl=gs_acl) | 150 slave_utils.GSUtilCopyFile(zip_file, gs_base, gs_acl=gs_acl) |
| 152 slave_utils.GSUtilCopyFile(full_results_json, gs_base, gs_acl=gs_acl) | 151 slave_utils.GSUtilCopyFile(full_results_json, gs_base, gs_acl=gs_acl) |
| 153 slave_utils.GSUtilCopyFile(failing_results_json, gs_base, gs_acl=gs_acl) | 152 slave_utils.GSUtilCopyFile(failing_results_json, gs_base, gs_acl=gs_acl) |
| 154 else: | 153 else: |
| 155 slave_utils.MaybeMakeDirectoryOnArchiveHost(dest_dir) | 154 slave_utils.MaybeMakeDirectoryOnArchiveHost(dest_dir) |
| 156 slave_utils.CopyFileToArchiveHost(zip_file, dest_dir) | 155 slave_utils.CopyFileToArchiveHost(zip_file, dest_dir) |
| 157 slave_utils.CopyFileToArchiveHost(full_results_json, dest_dir) | 156 slave_utils.CopyFileToArchiveHost(full_results_json, dest_dir) |
| 158 slave_utils.CopyFileToArchiveHost(failing_results_json, dest_dir) | 157 slave_utils.CopyFileToArchiveHost(failing_results_json, dest_dir) |
| 159 # Not supported on Google Storage yet. | 158 # Not supported on Google Storage yet. |
| 160 _ArchiveFullLayoutTestResults(staging_dir, dest_parent_dir, diff_file_list, | 159 _ArchiveFullLayoutTestResults(staging_dir, dest_parent_dir, diff_file_list, |
| 161 options) | 160 options) |
| 162 return 0 | 161 return 0 |
| 163 | 162 |
| 164 | 163 |
| 165 def main(): | 164 def main(): |
| 166 option_parser = optparse.OptionParser() | 165 option_parser = optparse.OptionParser() |
| 167 option_parser.add_option('', '--build-dir', default='webkit', | 166 option_parser.add_option('', '--build-dir', default='webkit', |
| 168 help='path to main build directory (the parent of ' | 167 help='path to main build directory (the parent of ' |
| 169 'the Release or Debug directory)') | 168 'the Release or Debug directory)') |
| 170 option_parser.add_option('', '--results-dir', | 169 option_parser.add_option('', '--results-dir', |
| 171 help='path to layout test results, relative to ' | 170 help='path to layout test results, relative to ' |
| 172 'the build_dir') | 171 'the build_dir') |
| 173 option_parser.add_option('', '--builder-name', | 172 option_parser.add_option('', '--builder-name', |
| 174 default=None, | 173 default=None, |
| 175 help='The name of the builder running this script.') | 174 help='The name of the builder running this script.') |
| 176 option_parser.add_option('', '--build-number', | 175 option_parser.add_option('', '--build-number', |
| 177 default=None, | 176 default=None, |
| 178 help=('The build number of the builder running' | 177 help=('The build number of the builder running' |
| 179 'this script.')) | 178 'this script.')) |
| 179 option_parser.add_option('', '--gs-bucket', | |
| 180 default=None, | |
| 181 help=('The google storage bucket to upload to. ' | |
| 182 'If provided, this script will upload to gs ' | |
| 183 'instead of the master.')) | |
| 184 option_parser.add_option('', '--gs-acl', | |
| 185 default=None, | |
| 186 help=('The ACL of the google storage files.')) | |
| 180 chromium_utils.AddPropertiesOptions(option_parser) | 187 chromium_utils.AddPropertiesOptions(option_parser) |
| 181 options, args = option_parser.parse_args() | 188 options, args = option_parser.parse_args() |
| 189 | |
| 190 # To continue supporting buildbot, initialize these from the | |
| 191 # factory_properties if they were not supplied on the command line. | |
| 192 if not options.gs_bucket: | |
| 193 options.gs_bucket = options.factory_properties.get('gs_bucket') | |
| 194 if not options.gs_acl: | |
| 195 options.gs_acl = options.factory_properties.get('gs_acl') | |
| 196 | |
| 182 return archive_layout(options, args) | 197 return archive_layout(options, args) |
| 183 | 198 |
| 184 | 199 |
| 185 if '__main__' == __name__: | 200 if '__main__' == __name__: |
| 186 sys.exit(main()) | 201 sys.exit(main()) |
| OLD | NEW |