Index: slave/skia_slave_scripts/upload_rendered_skps.py |
diff --git a/slave/skia_slave_scripts/upload_rendered_skps.py b/slave/skia_slave_scripts/upload_rendered_skps.py |
index d3fd49d35a8b36de9e4ac383e24431d12038473e..6ff8fa511a602343dc851baa16315668061d8e44 100644 |
--- a/slave/skia_slave_scripts/upload_rendered_skps.py |
+++ b/slave/skia_slave_scripts/upload_rendered_skps.py |
@@ -3,17 +3,19 @@ |
# Use of this source code is governed by a BSD-style license that can be |
# found in the LICENSE file. |
-"""Uploads the results of render_skps.py. |
- |
-TODO(epoger): In the midst of re-implementing using checksums; |
-see https://code.google.com/p/skia/issues/detail?id=1942 |
-""" |
+"""Uploads the results of render_skps.py.""" |
+import os |
+import posixpath |
import sys |
-from build_step import BuildStep |
+from build_step import BuildStep, PLAYBACK_CANNED_ACL |
+from utils import gs_utils |
+import skia_vars |
import upload_gm_results |
+SUBDIR_NAME = 'rendered-skps' |
+ |
class UploadRenderedSKPs(upload_gm_results.UploadGMResults): |
@@ -22,9 +24,26 @@ class UploadRenderedSKPs(upload_gm_results.UploadGMResults): |
attempts=attempts, **kwargs) |
def _Run(self): |
- self._SVNUploadJsonFiles(src_dir=self.skp_out_dir, |
- dest_subdir='rendered-skps') |
- |
+ # Upload individual image files to Google Storage. |
+ src_dir = os.path.abspath(self.playback_actual_images_dir) |
+ if os.listdir(src_dir): |
epoger
2014/05/21 18:21:16
Local testing verifies that patchset 3 fixes the U
epoger
2014/05/21 18:22:56
example of a production error this would have prev
|
+ dest_dir=posixpath.join( |
+ skia_vars.GetGlobalVariable('googlestorage_bucket'), SUBDIR_NAME) |
+ print 'Uploading image files from %s to %s.' % ( |
+ src_dir, dest_dir) |
+ gs_utils.copy_storage_directory(src_dir=src_dir, dest_dir=dest_dir, |
+ gs_acl=PLAYBACK_CANNED_ACL) |
+ else: |
+ print ('No image files in %s, so skipping upload to Google Storage.' % |
+ src_dir) |
+ |
+ # Upload image summaries (checksums) to skia-autogen. |
+ # |
+ # TODO(epoger): Change ACLs of files uploaded to Google Storage to |
+ # google.com:READ . See _SetGoogleReadACLs() in |
+ # https://skia.googlesource.com/buildbot/+/master/slave/skia_slave_scripts/webpages_playback.py |
+ self._SVNUploadJsonFiles(src_dir=self.playback_actual_summaries_dir, |
+ dest_subdir=SUBDIR_NAME) |
if '__main__' == __name__: |
sys.exit(BuildStep.RunBuildStep(UploadRenderedSKPs)) |