Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(328)

Unified Diff: scripts/slave/chromium/archive_layout_test_retry_summary.py

Issue 2442693003: Upload retry summary to desired location instead of uploading then moving. (Closed)
Patch Set: Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: scripts/slave/chromium/archive_layout_test_retry_summary.py
diff --git a/scripts/slave/chromium/archive_layout_test_retry_summary.py b/scripts/slave/chromium/archive_layout_test_retry_summary.py
index f945784cddb2620d091a91d1077a1d0d8c24c335..bdb27239edc15b2382e8cb44a3a50c05845b4257 100755
--- a/scripts/slave/chromium/archive_layout_test_retry_summary.py
+++ b/scripts/slave/chromium/archive_layout_test_retry_summary.py
@@ -4,19 +4,22 @@
# found in the LICENSE file.
"""This script is intended to archive retry summary results from
-try bot retries for layout tests along with layout test results.
+try bot retries of layout tests.
-The purpose if this is so that these retry results can be fetched
-from the same place that the first run results are fetched.
+By keeping these retry summary results in the same place as the
+layout test results from the first try (with patch), the retry
+results can be easily fetched from the same location as the results.
"""
-import logging
import argparse
+import logging
import os
import re
import socket
+import shutil
import sys
+from slave import robust_tempdir
from slave import slave_utils
@@ -27,11 +30,11 @@ def ArchiveRetrySummary(args):
print 'Host name: %s' % socket.gethostname()
gs_base = '/'.join([args.gs_bucket, args.builder_name, args.build_number])
- slave_utils.GSUtilCopyFile(args.retry_summary_json,
- gs_base,
- cache_control="public, max-age=31556926")
- slave_utils.GSUtilMoveFile(os.path.join(gs_base, args.retry_summary_json),
- os.path.join(gs_base, 'retry_summary.json'))
+ with robust_tempdir.RobustTempdir(prefix='retry-summary') as temp_dir:
+ temp_path = os.path.join(temp_dir, 'retry_summary.json')
Paweł Hajdan Jr. 2016/10/24 12:07:18 I'm wondering whether this works. Could you expli
qyearsley 2016/10/24 16:48:48 Oh, I see -- robust_tempdir.RobustTempdir() gives
+ shutil.copyfile(args.retry_summary_json, temp_path)
+ slave_utils.GSUtilCopyFile(temp_path, gs_base,
Paweł Hajdan Jr. 2016/10/24 12:07:18 Why do we copy to temporary directory for this? I
qyearsley 2016/10/24 16:48:48 The reason for this is that slave_utils.GSUtilCopy
+ cache_control='public, max-age=31556926')
return 0
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698