Chromium Code Reviews| 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 |
| new file mode 100755 |
| index 0000000000000000000000000000000000000000..f945784cddb2620d091a91d1077a1d0d8c24c335 |
| --- /dev/null |
| +++ b/scripts/slave/chromium/archive_layout_test_retry_summary.py |
| @@ -0,0 +1,58 @@ |
| +#!/usr/bin/env python |
| +# Copyright 2016 The Chromium Authors. All rights reserved. |
| +# Use of this source code is governed by a BSD-style license that can be |
| +# 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. |
| + |
| +The purpose if this is so that these retry results can be fetched |
| +from the same place that the first run results are fetched. |
| +""" |
| + |
| +import logging |
| +import argparse |
| +import os |
| +import re |
| +import socket |
| +import sys |
| + |
| +from slave import slave_utils |
| + |
| + |
| +def ArchiveRetrySummary(args): |
| + args.builder_name = re.sub('[ .()]', '_', args.builder_name) |
| + print 'Builder name: %s' % args.builder_name |
| + print 'Build number: %s' % args.build_number |
| + 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')) |
|
qyearsley
2016/10/17 20:21:46
Alternately, instead of moving it after uploading,
Dirk Pranke
2016/10/17 21:29:26
Why are you moving instead of copying? I would be
qyearsley
2016/10/17 21:43:52
The reason for renaming the file here is that the
Dirk Pranke
2016/10/17 21:55:33
Oh, sorry, I misread this and you're copying it to
|
| + return 0 |
| + |
| + |
| +def _ParseArgs(): |
| + parser = argparse.ArgumentParser() |
| + parser.add_argument('--retry-summary-json', type=str, required=True, |
| + help='path to retry summary JSON file') |
| + parser.add_argument('--builder-name', type=str, required=True) |
| + parser.add_argument('--build-number', type=str, required=True) |
| + parser.add_argument('--gs-bucket', type=str, required=True) |
| + return parser.parse_args() |
| + |
| + |
| +def main(): |
| + args = _ParseArgs() |
| + logging.basicConfig(level=logging.INFO, |
| + format='%(asctime)s %(filename)s:%(lineno)-3d' |
| + ' %(levelname)s %(message)s', |
| + datefmt='%y%m%d %H:%M:%S') |
| + return ArchiveRetrySummary(args) |
| + |
| + |
| +if '__main__' == __name__: |
| + sys.exit(main()) |