OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright (c) 2013 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2013 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 """Upload results from running skimage.""" | 6 """Upload results from running skimage.""" |
7 | 7 |
| 8 import os |
8 import posixpath | 9 import posixpath |
| 10 import skia_vars |
9 import sys | 11 import sys |
10 | 12 |
11 from utils import gs_utils | 13 from utils import gs_utils |
12 from utils import sync_bucket_subdir | 14 from utils import sync_bucket_subdir |
13 from build_step import PLAYBACK_CANNED_ACL | 15 from build_step import PLAYBACK_CANNED_ACL |
14 from build_step import BuildStep | 16 from build_step import BuildStep |
15 | 17 |
16 import build_step | 18 import build_step |
17 | 19 |
18 SKP_TIMEOUT_MULTIPLIER = 8 | 20 SKP_TIMEOUT_MULTIPLIER = 8 |
(...skipping 16 matching lines...) Expand all Loading... |
35 """ | 37 """ |
36 build_step.BuildStep.__init__(self, timeout=timeout, | 38 build_step.BuildStep.__init__(self, timeout=timeout, |
37 no_output_timeout=no_output_timeout, | 39 no_output_timeout=no_output_timeout, |
38 **kwargs) | 40 **kwargs) |
39 | 41 |
40 self._dest_gsbase = (self._args.get('dest_gsbase') or | 42 self._dest_gsbase = (self._args.get('dest_gsbase') or |
41 sync_bucket_subdir.DEFAULT_PERFDATA_GS_BASE) | 43 sync_bucket_subdir.DEFAULT_PERFDATA_GS_BASE) |
42 | 44 |
43 def _Run(self): | 45 def _Run(self): |
44 if self._do_upload_results: | 46 if self._do_upload_results: |
| 47 # Copy actual-results.json to skimage/output/actuals |
| 48 print '\n\n====Uploading skimage actual-results to Google Storage====\n\n' |
| 49 src_dir = os.path.abspath(os.path.join(self._skimage_out_dir, |
| 50 self._builder_name)) |
| 51 dest_dir = posixpath.join( |
| 52 skia_vars.GetGlobalVariable('googlestorage_bucket'), |
| 53 'skimage', 'actuals', self._builder_name) |
| 54 http_header_lines = ['Cache-Control:public,max-age=3600'] |
| 55 gs_utils.CopyStorageDirectory(src_dir=src_dir, |
| 56 dest_dir=dest_dir, |
| 57 gs_acl='public-read', |
| 58 http_header_lines=http_header_lines) |
| 59 |
45 # Copy actual images and expectations to Google Storage. | 60 # Copy actual images and expectations to Google Storage. |
| 61 # TODO(scroggo): This step uploads both the expectations and the |
| 62 # mismatches, even though the expectations files were already uploaded |
| 63 # in the above step. Once skimage is rewritten to include the hash digest |
| 64 # in the filename, rewrite this to upload a folder (named <input image>) |
| 65 # containing the result (named <hash digest>.png), much like |
| 66 # upload_gm_results. |
46 print '\n\n========Uploading skimage results to Google Storage=======\n\n' | 67 print '\n\n========Uploading skimage results to Google Storage=======\n\n' |
47 relative_dir = posixpath.join('skimage', 'output', self._builder_name) | 68 relative_dir = posixpath.join('skimage', 'output', self._builder_name) |
48 gs_utils.UploadDirectoryContentsIfChanged( | 69 gs_utils.UploadDirectoryContentsIfChanged( |
49 gs_base=self._dest_gsbase, | 70 gs_base=self._dest_gsbase, |
50 gs_relative_dir=relative_dir, | 71 gs_relative_dir=relative_dir, |
51 gs_acl=PLAYBACK_CANNED_ACL, | 72 gs_acl=PLAYBACK_CANNED_ACL, |
52 force_upload=True, | 73 force_upload=True, |
53 local_dir=self._skimage_out_dir) | 74 local_dir=self._skimage_out_dir) |
54 | 75 |
55 if '__main__' == __name__: | 76 if '__main__' == __name__: |
56 sys.exit(BuildStep.RunBuildStep(UploadSKImageResults)) | 77 sys.exit(BuildStep.RunBuildStep(UploadSKImageResults)) |
OLD | NEW |