Do not upload to trusted partner's bucket if it is a dry run
authorrmistry <rmistry@google.com>
Wed, 3 Feb 2016 15:08:02 +0000 (07:08 -0800)
committerCommit bot <commit-bot@chromium.org>
Wed, 3 Feb 2016 15:08:02 +0000 (07:08 -0800)
BUG=skia:3751
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1665803002

# Trybots do not exercise this code.
NOTRY=true

Review URL: https://codereview.chromium.org/1665803002

tools/skp/recreate_skps.py

index 46412771309d5052bddeedbd954a8b39faf728e3..b7ca07a9a7e559aa9ddda8c6e2c20486af8d666d 100644 (file)
@@ -36,8 +36,9 @@ def _get_skp_version():
     new_version += 1
 
 
-def main(chrome_src_path, browser_executable):
+def main(chrome_src_path, browser_executable, dry_run):
   browser_executable = os.path.realpath(browser_executable)
+  dry_run = (dry_run == 'True')
   skp_version = _get_skp_version()
   print 'SKP_VERSION=%d' % skp_version
 
@@ -58,10 +59,11 @@ def main(chrome_src_path, browser_executable):
     '--browser_executable', browser_executable,
     '--non-interactive',
     '--upload',
-    '--upload_to_partner_bucket',
     '--alternate_upload_dir', upload_dir,
     '--chrome_src_path', chrome_src_path,
   ]
+  if not dry_run:
+    webpages_playback_cmd.append('--upload_to_partner_bucket')
 
   try:
     shell_utils.run(webpages_playback_cmd)
@@ -87,7 +89,8 @@ def main(chrome_src_path, browser_executable):
 
 
 if '__main__' == __name__:
-  if len(sys.argv) != 3:
-    print >> sys.stderr, 'USAGE: %s <chrome src path> <browser executable>'
+  if len(sys.argv) != 4:
+    print >> sys.stderr, ('USAGE: %s <chrome src path> <browser executable> '
+                          '<dry run>')
     sys.exit(1)
   main(*sys.argv[1:])