OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright (c) 2014 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2014 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 | 6 |
7 """rebase.py: standalone script to batch update bench expectations. | 7 """rebase.py: standalone script to batch update bench expectations. |
8 | 8 |
9 Requires gsutil to access gs://chromium-skia-gm and Rietveld credentials. | 9 Requires gsutil to access gs://chromium-skia-gm and Rietveld credentials. |
10 | 10 |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 proc = subprocess.Popen(['gsutil', 'ls', | 63 proc = subprocess.Popen(['gsutil', 'ls', |
64 '/'.join([GS_PREFIX, p, 'bench_' + h + '_data_skp_*'])], | 64 '/'.join([GS_PREFIX, p, 'bench_' + h + '_data_skp_*'])], |
65 stdout=subprocess.PIPE) | 65 stdout=subprocess.PIPE) |
66 out, err = proc.communicate() | 66 out, err = proc.communicate() |
67 if err or not out: | 67 if err or not out: |
68 return [] | 68 return [] |
69 return [i for i in out.strip().split('\n') if not filter_file(i)] | 69 return [i for i in out.strip().split('\n') if not filter_file(i)] |
70 | 70 |
71 def download_gs_files(p, h, gs_dir): | 71 def download_gs_files(p, h, gs_dir): |
72 print 'Downloading raw bench files from Google Storage...' | 72 print 'Downloading raw bench files from Google Storage...' |
73 proc = subprocess.Popen(['gsutil', 'cp', '-q', | 73 proc = subprocess.Popen(['gsutil', 'cp', |
74 '/'.join([GS_PREFIX, p, 'bench_' + h + '_data_skp_*']), | 74 '/'.join([GS_PREFIX, p, 'bench_' + h + '_data_skp_*']), |
75 '%s/%s' % (gs_dir, p)], | 75 '%s/%s' % (gs_dir, p)], |
76 stdout=subprocess.PIPE) | 76 stdout=subprocess.PIPE) |
77 out, err = proc.communicate() | 77 out, err = proc.communicate() |
78 if err: | 78 if err: |
79 clean_dir(gs_dir) | 79 clean_dir(gs_dir) |
80 return False | 80 return False |
81 files = 0 | 81 files = 0 |
82 for f in os.listdir(os.path.join(gs_dir, p)): | 82 for f in os.listdir(os.path.join(gs_dir, p)): |
83 if filter_file(f): | 83 if filter_file(f): |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
239 print 'ERROR uploading expectations using git.' | 239 print 'ERROR uploading expectations using git.' |
240 elif not commit: | 240 elif not commit: |
241 print 'CL created. Please take a look at the link above.' | 241 print 'CL created. Please take a look at the link above.' |
242 else: | 242 else: |
243 print 'New bench baselines should be in CQ now.' | 243 print 'New bench baselines should be in CQ now.' |
244 delete_dirs([gs_dir, exp_dir]) | 244 delete_dirs([gs_dir, exp_dir]) |
245 | 245 |
246 | 246 |
247 if __name__ == "__main__": | 247 if __name__ == "__main__": |
248 main() | 248 main() |
OLD | NEW |