Chromium Code Reviews| Index: scripts/slave/recipes/skia/swarm_RecreateSKPs.py |
| diff --git a/scripts/slave/recipes/skia/swarm_RecreateSKPs.py b/scripts/slave/recipes/skia/swarm_RecreateSKPs.py |
| index edf43e3f70d464c7a842a999ef9cbdbdb732857a..aacaa1eb66de7b75ea5e8c594a28547e6ee71bdb 100644 |
| --- a/scripts/slave/recipes/skia/swarm_RecreateSKPs.py |
| +++ b/scripts/slave/recipes/skia/swarm_RecreateSKPs.py |
| @@ -13,6 +13,7 @@ DEPS = [ |
| 'recipe_engine/python', |
| 'recipe_engine/raw_io', |
| 'recipe_engine/step', |
| + 'file', |
|
rmistry
2016/07/22 14:26:14
nit: sort
borenet
2016/07/22 14:49:53
Done.
|
| 'skia', |
| ] |
| @@ -129,25 +130,46 @@ with open(dest_path, 'w') as f: |
| f.write(contents) |
| """ % boto_file) |
| + # Clean up the output dir. |
| + output_dir = api.path['slave_build'].join('skp_output') |
| + if api.path.exists(output_dir): |
| + api.file.rmtree('skp_output', output_dir) |
| + api.file.makedirs('skp_output', output_dir) |
| + |
| # Capture the SKPs. |
| - with depot_tools_auth(api, UPDATE_SKPS_KEY): |
| - cmd = ['python', api.path['build'].join('scripts', 'slave', 'skia', |
| - 'recreate_skps.py'), |
| - src_dir, |
| - src_dir.join('out', 'Release', 'chrome')] |
| - if 'Canary' in api.properties['buildername']: |
| - cmd.append('--dry-run') |
| - path_var= api.path.pathsep.join([str(api.path['depot_tools']), '%(PATH)s']) |
| - api.step('Recreate SKPs', |
| - cmd=cmd, |
| - cwd=api.skia.checkout_root.join('skia'), |
| - env={ |
| - 'AWS_CREDENTIAL_FILE': boto_file, |
| - 'BOTO_CONFIG': boto_file, |
| - 'CHROME_HEADLESS': '1', |
| - 'PATH': path_var, |
| - }, |
| - ) |
| + path_var= api.path.pathsep.join([str(api.path['depot_tools']), '%(PATH)s']) |
| + env = { |
| + 'CHROME_HEADLESS': '1', |
| + 'PATH': path_var, |
| + } |
| + boto_env = { |
| + 'AWS_CREDENTIAL_FILE': boto_file, |
| + 'BOTO_CONFIG': boto_file, |
| + } |
| + recreate_skps_env = {} |
| + recreate_skps_env.update(env) |
| + recreate_skps_env.update(boto_env) |
| + asset_dir = api.skia.infrabots_dir.join('assets', 'skp') |
| + cmd = ['python', asset_dir.join('create.py'), |
| + '--chrome_src_path', src_dir, |
| + '--browser_executable', src_dir.join('out', 'Release', 'chrome'), |
| + '--target_dir', output_dir] |
| + api.step('Recreate SKPs', |
| + cmd=cmd, |
| + cwd=api.skia.skia_dir, |
| + env=recreate_skps_env) |
| + |
| + # Upload the SKPs. |
| + if 'Canary' not in api.properties['buildername']: |
| + cmd = ['python', |
| + api.path['build'].join('scripts', 'slave', 'skia', 'upload_skps.py'), |
| + '--target_dir', output_dir] |
| + with depot_tools_auth(api, UPDATE_SKPS_KEY): |
| + api.step('Upload SKPs', |
| + cmd=cmd, |
| + cwd=api.skia.skia_dir, |
| + env=env) |
| + |
| def GenTests(api): |
| for mastername, slaves in TEST_BUILDERS.iteritems(): |
| @@ -160,6 +182,7 @@ def GenTests(api): |
| slavename=slavename, |
| revision='abc123', |
| buildnumber=2, |
| - swarm_out_dir='[SWARM_OUT_DIR]') |
| + swarm_out_dir='[SWARM_OUT_DIR]') + |
| + api.path.exists(api.path['slave_build'].join('skp_output')) |
| ) |
| yield test |