OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 | 2 |
3 | 3 |
4 # Copyright (c) 2014 The Chromium Authors. All rights reserved. | 4 # Copyright (c) 2014 The Chromium Authors. All rights reserved. |
5 # Use of this source code is governed by a BSD-style license that can be | 5 # Use of this source code is governed by a BSD-style license that can be |
6 # found in the LICENSE file. | 6 # found in the LICENSE file. |
7 | 7 |
8 | 8 |
9 """greenify.py: standalone script to correct flaky bench expectations. | 9 """greenify.py: standalone script to correct flaky bench expectations. |
10 | 10 |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 'https://skia.googlesource.com/skia.git', '.']): | 53 'https://skia.googlesource.com/skia.git', '.']): |
54 status = False | 54 status = False |
55 subprocess.call(['git', 'checkout', 'master']) | 55 subprocess.call(['git', 'checkout', 'master']) |
56 subprocess.call(['git', 'pull']) | 56 subprocess.call(['git', 'pull']) |
57 os.chdir(old_cwd) | 57 os.chdir(old_cwd) |
58 return status | 58 return status |
59 | 59 |
60 def git_commit_expectations(repo_dir, exp_dir, bot, build, commit): | 60 def git_commit_expectations(repo_dir, exp_dir, bot, build, commit): |
61 commit_msg = """Greenify bench bot %s at build %s | 61 commit_msg = """Greenify bench bot %s at build %s |
62 | 62 |
63 TBR=bsalomon@google.com | 63 TBR=bsalomon@google.com |
64 | 64 |
65 Bypassing trybots: | 65 Bypassing trybots: |
66 NOTRY=true""" % (bot, build) | 66 NOTRY=true""" % (bot, build) |
67 old_cwd = os.getcwd() | 67 old_cwd = os.getcwd() |
68 os.chdir(repo_dir) | 68 os.chdir(repo_dir) |
69 upload = ['git', 'cl', 'upload', '-f', '--bypass-hooks', | 69 upload = ['git', 'cl', 'upload', '-f', '--bypass-hooks', |
70 '--bypass-watchlists', '-m', commit_msg] | 70 '--bypass-watchlists', '-m', commit_msg] |
71 if commit: | 71 if commit: |
72 upload.append('--use-commit-queue') | 72 upload.append('--use-commit-queue') |
73 branch = exp_dir[exp_dir.rfind('/') + 1:] | 73 branch = exp_dir[exp_dir.rfind('/') + 1:] |
74 filename = 'bench_expectations_%s.txt' % bot | 74 filename = 'bench_expectations_%s.txt' % bot |
75 cmds = ([['git', 'checkout', 'master'], | 75 cmds = ([['git', 'checkout', 'master'], |
76 ['git', 'pull'], | 76 ['git', 'pull'], |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
196 print 'ERROR uploading expectations using git.' | 196 print 'ERROR uploading expectations using git.' |
197 elif not commit: | 197 elif not commit: |
198 print 'CL created. Please take a look at the link above.' | 198 print 'CL created. Please take a look at the link above.' |
199 else: | 199 else: |
200 print 'New bench baselines should be in CQ now.' | 200 print 'New bench baselines should be in CQ now.' |
201 delete_dirs([exp_dir]) | 201 delete_dirs([exp_dir]) |
202 | 202 |
203 | 203 |
204 if __name__ == "__main__": | 204 if __name__ == "__main__": |
205 main() | 205 main() |
OLD | NEW |