| OLD | NEW |
| 1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 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 | 5 |
| 6 """Recipe for the Skia RecreateSKPs Bot.""" | 6 """Recipe for the Skia RecreateSKPs Bot.""" |
| 7 | 7 |
| 8 | 8 |
| 9 DEPS = [ | 9 DEPS = [ |
| 10 'build/file', | 10 'build/file', |
| 11 'core', |
| 11 'depot_tools/gclient', | 12 'depot_tools/gclient', |
| 12 'recipe_engine/path', | 13 'recipe_engine/path', |
| 13 'recipe_engine/properties', | 14 'recipe_engine/properties', |
| 14 'recipe_engine/python', | 15 'recipe_engine/python', |
| 15 'recipe_engine/raw_io', | 16 'recipe_engine/raw_io', |
| 16 'recipe_engine/step', | 17 'recipe_engine/step', |
| 17 'skia', | 18 'vars', |
| 18 ] | 19 ] |
| 19 | 20 |
| 20 | 21 |
| 21 TEST_BUILDERS = { | 22 TEST_BUILDERS = { |
| 22 'client.skia.compile': { | 23 'client.skia.compile': { |
| 23 'skiabot-linux-swarm-000': [ | 24 'skiabot-linux-swarm-000': [ |
| 24 'Housekeeper-Nightly-RecreateSKPs_Canary', | 25 'Housekeeper-Nightly-RecreateSKPs_Canary', |
| 25 'Housekeeper-Weekly-RecreateSKPs', | 26 'Housekeeper-Weekly-RecreateSKPs', |
| 26 ], | 27 ], |
| 27 }, | 28 }, |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 backup_file = os.path.join(home, TOKEN_FILE_BACKUP) | 85 backup_file = os.path.join(home, TOKEN_FILE_BACKUP) |
| 85 if os.path.isfile(backup_file): | 86 if os.path.isfile(backup_file): |
| 86 os.rename(backup_file, token_file) | 87 os.rename(backup_file, token_file) |
| 87 """ % (DEPOT_TOOLS_AUTH_TOKEN_FILE, | 88 """ % (DEPOT_TOOLS_AUTH_TOKEN_FILE, |
| 88 DEPOT_TOOLS_AUTH_TOKEN_FILE_BACKUP), | 89 DEPOT_TOOLS_AUTH_TOKEN_FILE_BACKUP), |
| 89 ) | 90 ) |
| 90 | 91 |
| 91 | 92 |
| 92 def RunSteps(api): | 93 def RunSteps(api): |
| 93 # Check out Chrome. | 94 # Check out Chrome. |
| 94 api.skia.setup() | 95 api.core.setup() |
| 95 | 96 |
| 96 src_dir = api.skia.checkout_root.join('src') | 97 src_dir = api.vars.checkout_root.join('src') |
| 97 out_dir = src_dir.join('out', 'Release') | 98 out_dir = src_dir.join('out', 'Release') |
| 98 | 99 |
| 99 # Call GN. | 100 # Call GN. |
| 100 platform = 'linux64' # This bot only runs on linux; don't bother checking. | 101 platform = 'linux64' # This bot only runs on linux; don't bother checking. |
| 101 gn = src_dir.join('buildtools', platform, 'gn') | 102 gn = src_dir.join('buildtools', platform, 'gn') |
| 102 api.step('GN', | 103 api.step('GN', |
| 103 [gn, 'gen', out_dir], | 104 [gn, 'gen', out_dir], |
| 104 env={'CPPFLAGS': '-DSK_ALLOW_CROSSPROCESS_PICTUREIMAGEFILTERS=1', | 105 env={'CPPFLAGS': '-DSK_ALLOW_CROSSPROCESS_PICTUREIMAGEFILTERS=1', |
| 105 'GYP_GENERATORS': 'ninja'}, | 106 'GYP_GENERATORS': 'ninja'}, |
| 106 cwd=src_dir) | 107 cwd=src_dir) |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 'CHROME_HEADLESS': '1', | 144 'CHROME_HEADLESS': '1', |
| 144 'PATH': path_var, | 145 'PATH': path_var, |
| 145 } | 146 } |
| 146 boto_env = { | 147 boto_env = { |
| 147 'AWS_CREDENTIAL_FILE': boto_file, | 148 'AWS_CREDENTIAL_FILE': boto_file, |
| 148 'BOTO_CONFIG': boto_file, | 149 'BOTO_CONFIG': boto_file, |
| 149 } | 150 } |
| 150 recreate_skps_env = {} | 151 recreate_skps_env = {} |
| 151 recreate_skps_env.update(env) | 152 recreate_skps_env.update(env) |
| 152 recreate_skps_env.update(boto_env) | 153 recreate_skps_env.update(boto_env) |
| 153 asset_dir = api.skia.infrabots_dir.join('assets', 'skp') | 154 asset_dir = api.vars.infrabots_dir.join('assets', 'skp') |
| 154 cmd = ['python', asset_dir.join('create.py'), | 155 cmd = ['python', asset_dir.join('create.py'), |
| 155 '--chrome_src_path', src_dir, | 156 '--chrome_src_path', src_dir, |
| 156 '--browser_executable', src_dir.join('out', 'Release', 'chrome'), | 157 '--browser_executable', src_dir.join('out', 'Release', 'chrome'), |
| 157 '--target_dir', output_dir] | 158 '--target_dir', output_dir] |
| 158 if 'Canary' not in api.properties['buildername']: | 159 if 'Canary' not in api.properties['buildername']: |
| 159 cmd.append('--upload_to_partner_bucket') | 160 cmd.append('--upload_to_partner_bucket') |
| 160 api.step('Recreate SKPs', | 161 api.step('Recreate SKPs', |
| 161 cmd=cmd, | 162 cmd=cmd, |
| 162 cwd=api.skia.skia_dir, | 163 cwd=api.vars.skia_dir, |
| 163 env=recreate_skps_env) | 164 env=recreate_skps_env) |
| 164 | 165 |
| 165 # Upload the SKPs. | 166 # Upload the SKPs. |
| 166 if 'Canary' not in api.properties['buildername']: | 167 if 'Canary' not in api.properties['buildername']: |
| 167 cmd = ['python', | 168 cmd = ['python', |
| 168 api.skia.skia_dir.join('infra', 'bots', 'upload_skps.py'), | 169 api.vars.skia_dir.join('infra', 'bots', 'upload_skps.py'), |
| 169 '--target_dir', output_dir] | 170 '--target_dir', output_dir] |
| 170 with depot_tools_auth(api, UPDATE_SKPS_KEY): | 171 with depot_tools_auth(api, UPDATE_SKPS_KEY): |
| 171 api.step('Upload SKPs', | 172 api.step('Upload SKPs', |
| 172 cmd=cmd, | 173 cmd=cmd, |
| 173 cwd=api.skia.skia_dir, | 174 cwd=api.vars.skia_dir, |
| 174 env=env) | 175 env=env) |
| 175 | 176 |
| 176 | 177 |
| 177 def GenTests(api): | 178 def GenTests(api): |
| 178 for mastername, slaves in TEST_BUILDERS.iteritems(): | 179 for mastername, slaves in TEST_BUILDERS.iteritems(): |
| 179 for slavename, builders_by_slave in slaves.iteritems(): | 180 for slavename, builders_by_slave in slaves.iteritems(): |
| 180 for builder in builders_by_slave: | 181 for builder in builders_by_slave: |
| 181 test = ( | 182 test = ( |
| 182 api.test(builder) + | 183 api.test(builder) + |
| 183 api.properties(buildername=builder, | 184 api.properties(buildername=builder, |
| 184 mastername=mastername, | 185 mastername=mastername, |
| 185 slavename=slavename, | 186 slavename=slavename, |
| 186 revision='abc123', | 187 revision='abc123', |
| 187 buildnumber=2, | 188 buildnumber=2, |
| 188 path_config='kitchen', | 189 path_config='kitchen', |
| 189 swarm_out_dir='[SWARM_OUT_DIR]') + | 190 swarm_out_dir='[SWARM_OUT_DIR]') + |
| 190 api.path.exists(api.path['slave_build'].join('skp_output')) | 191 api.path.exists(api.path['slave_build'].join('skp_output')) |
| 191 ) | 192 ) |
| 192 yield test | 193 yield test |
| OLD | NEW |