| OLD | NEW |
| 1 # Copyright (c) 2014 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2014 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 """Create a CL to update the SKP version.""" | 5 """Create a CL to update the SKP version.""" |
| 6 | 6 |
| 7 | 7 |
| 8 import os | 8 import os |
| 9 import re | 9 import re |
| 10 import sys | 10 import sys |
| 11 import time | 11 import time |
| 12 | 12 |
| 13 from build_step import BuildStep | 13 from build_step import BuildStep |
| 14 from config_private import SKIA_GIT_URL | 14 from config_private import SKIA_GIT_URL |
| 15 from py.utils.git_utils import GIT | 15 from py.utils.git_utils import GIT |
| 16 from py.utils import git_utils |
| 16 from py.utils import misc | 17 from py.utils import misc |
| 17 from py.utils import shell_utils | 18 from py.utils import shell_utils |
| 18 | 19 |
| 19 | 20 |
| 20 CHROMIUM_SKIA = 'https://chromium.googlesource.com/skia.git' | 21 CHROMIUM_SKIA = 'https://chromium.googlesource.com/skia.git' |
| 21 COMMIT_MSG = '''Update SKP version to %s | 22 COMMIT_MSG = '''Update SKP version to %s |
| 22 | 23 |
| 23 Automatic commit by the RecreateSKPs bot. | 24 Automatic commit by the RecreateSKPs bot. |
| 24 | 25 |
| 25 TBR= | 26 TBR= |
| (...skipping 23 matching lines...) Expand all Loading... |
| 49 shell_utils.run([GIT, 'config', '--local', 'user.name', | 50 shell_utils.run([GIT, 'config', '--local', 'user.name', |
| 50 SKIA_COMMITTER_NAME]) | 51 SKIA_COMMITTER_NAME]) |
| 51 shell_utils.run([GIT, 'config', '--local', 'user.email', | 52 shell_utils.run([GIT, 'config', '--local', 'user.email', |
| 52 SKIA_COMMITTER_EMAIL]) | 53 SKIA_COMMITTER_EMAIL]) |
| 53 if CHROMIUM_SKIA in shell_utils.run([GIT, 'remote', '-v']): | 54 if CHROMIUM_SKIA in shell_utils.run([GIT, 'remote', '-v']): |
| 54 shell_utils.run([GIT, 'remote', 'set-url', 'origin', SKIA_GIT_URL, | 55 shell_utils.run([GIT, 'remote', 'set-url', 'origin', SKIA_GIT_URL, |
| 55 CHROMIUM_SKIA]) | 56 CHROMIUM_SKIA]) |
| 56 | 57 |
| 57 version_file = 'SKP_VERSION' | 58 version_file = 'SKP_VERSION' |
| 58 skp_version = self._args.get('skp_version') | 59 skp_version = self._args.get('skp_version') |
| 59 with misc.GitBranch(branch_name='update_skp_version', | 60 with git_utils.GitBranch(branch_name='update_skp_version', |
| 60 commit_msg=COMMIT_MSG % skp_version, | 61 commit_msg=COMMIT_MSG % skp_version, |
| 61 commit_queue=not self._is_try) as branch: | 62 commit_queue=not self._is_try) as branch: |
| 62 | 63 |
| 63 # First, upload a version of the CL with just the SKP version changed. | 64 # First, upload a version of the CL with just the SKP version changed. |
| 64 with open(version_file, 'w') as f: | 65 with open(version_file, 'w') as f: |
| 65 f.write(skp_version) | 66 f.write(skp_version) |
| 66 branch.commit_and_upload() | 67 branch.commit_and_upload() |
| 67 | 68 |
| 68 # Trigger trybots. | 69 # Trigger trybots. |
| 69 bots_to_trigger = [] | 70 bots_to_trigger = [] |
| 70 expectations_dir = os.path.join('expectations', 'bench') | 71 expectations_dir = os.path.join('expectations', 'bench') |
| 71 for expectations_file in os.listdir(expectations_dir): | 72 for expectations_file in os.listdir(expectations_dir): |
| (...skipping 17 matching lines...) Expand all Loading... |
| 89 wait() | 90 wait() |
| 90 while not bexpect.all_trybots_finished(codereview_url): | 91 while not bexpect.all_trybots_finished(codereview_url): |
| 91 wait() | 92 wait() |
| 92 | 93 |
| 93 # Add trybot results as new expectations. | 94 # Add trybot results as new expectations. |
| 94 bexpect.gen_bench_expectations_from_codereview(codereview_url) | 95 bexpect.gen_bench_expectations_from_codereview(codereview_url) |
| 95 | 96 |
| 96 | 97 |
| 97 if '__main__' == __name__: | 98 if '__main__' == __name__: |
| 98 sys.exit(BuildStep.RunBuildStep(UpdateSkpVersion)) | 99 sys.exit(BuildStep.RunBuildStep(UpdateSkpVersion)) |
| OLD | NEW |