aboutsummaryrefslogtreecommitdiffhomepage
path: root/infra
diff options
context:
space:
mode:
authorGravatar Robert Iannucci <iannucci@google.com>2017-05-12 19:09:38 -0700
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-05-15 13:46:22 +0000
commit297a7efd54495a06a7473eb8d99b211fd511766c (patch)
tree44b09641b37f75abe50d849a1082b6d9b6c6a459 /infra
parent9018952290a468886c819405c6d9495b4aa5d7d4 (diff)
[skia] convert recipes and module to new context module
This is a syntax-only change to convert to the new (documented) context module. R=borenet@google.com Bug: skia: Change-Id: Id907c309d3cf38b85a46f6d8d7ce90ed58ba026f Reviewed-on: https://skia-review.googlesource.com/16840 Commit-Queue: Eric Boren <borenet@google.com> Reviewed-by: Eric Boren <borenet@google.com>
Diffstat (limited to 'infra')
-rw-r--r--infra/bots/recipe_modules/core/__init__.py1
-rw-r--r--infra/bots/recipe_modules/core/api.py8
-rw-r--r--infra/bots/recipe_modules/env/__init__.py2
-rw-r--r--infra/bots/recipe_modules/env/api.py4
-rw-r--r--infra/bots/recipe_modules/env/example.py3
-rw-r--r--infra/bots/recipe_modules/flavor/__init__.py1
-rw-r--r--infra/bots/recipe_modules/flavor/flutter_flavor.py2
-rw-r--r--infra/bots/recipe_modules/flavor/gn_android_flavor.py4
-rw-r--r--infra/bots/recipe_modules/flavor/gn_chromebook_flavor.py9
-rw-r--r--infra/bots/recipe_modules/flavor/gn_flavor.py6
-rw-r--r--infra/bots/recipe_modules/flavor/pdfium_flavor.py4
-rw-r--r--infra/bots/recipe_modules/infra/__init__.py1
-rw-r--r--infra/bots/recipe_modules/infra/api.py4
-rw-r--r--infra/bots/recipe_modules/run/example.py3
-rw-r--r--infra/bots/recipe_modules/swarming/__init__.py1
-rw-r--r--infra/bots/recipe_modules/swarming/api.py2
-rw-r--r--infra/bots/recipe_modules/vars/__init__.py1
-rw-r--r--infra/bots/recipe_modules/vars/api.py2
-rw-r--r--infra/bots/recipes/bundle_recipes.py3
-rw-r--r--infra/bots/recipes/compile.py3
-rw-r--r--infra/bots/recipes/ct_skps.py3
-rw-r--r--infra/bots/recipes/housekeeper.py3
-rw-r--r--infra/bots/recipes/infra.py3
-rw-r--r--infra/bots/recipes/recreate_skps.py10
-rw-r--r--infra/bots/recipes/skpbench.py3
-rw-r--r--infra/bots/recipes/test.py5
-rw-r--r--infra/bots/recipes/upload_nano_results.py3
27 files changed, 52 insertions, 42 deletions
diff --git a/infra/bots/recipe_modules/core/__init__.py b/infra/bots/recipe_modules/core/__init__.py
index 9112c1c4f8..6b541c39aa 100644
--- a/infra/bots/recipe_modules/core/__init__.py
+++ b/infra/bots/recipe_modules/core/__init__.py
@@ -8,6 +8,7 @@ DEPS = [
'depot_tools/gclient',
'depot_tools/tryserver',
'flavor',
+ 'recipe_engine/context',
'recipe_engine/path',
'recipe_engine/properties',
'recipe_engine/python',
diff --git a/infra/bots/recipe_modules/core/api.py b/infra/bots/recipe_modules/core/api.py
index 0a2cb4ef1d..747416468a 100644
--- a/infra/bots/recipe_modules/core/api.py
+++ b/infra/bots/recipe_modules/core/api.py
@@ -41,7 +41,7 @@ class SkiaApi(recipe_api.RecipeApi):
git = 'git.bat'
else:
git = 'git'
- with self.m.step.context({'cwd': repo_path}):
+ with self.m.context(cwd=repo_path):
self.m.step('git remote set-url',
cmd=[git, 'remote', 'set-url', 'origin', repo.url],
infra_step=True)
@@ -159,13 +159,13 @@ class SkiaApi(recipe_api.RecipeApi):
self.m.bot_update._repository = patch_repo
self.m.gclient.c = gclient_cfg
- with self.m.step.context({'cwd': self.m.vars.checkout_root}):
+ with self.m.context(cwd=self.m.vars.checkout_root):
update_step = self.m.bot_update.ensure_checkout(patch_root=patch_root)
self.m.vars.got_revision = (
update_step.presentation.properties['got_revision'])
if self.m.vars.need_chromium_checkout:
- with self.m.step.context({'cwd': self.m.vars.checkout_root,
- 'env': self.m.vars.gclient_env}):
+ with self.m.context(cwd=self.m.vars.checkout_root,
+ env=self.m.vars.gclient_env):
self.m.gclient.runhooks()
diff --git a/infra/bots/recipe_modules/env/__init__.py b/infra/bots/recipe_modules/env/__init__.py
index 67d72f4fb8..774cf5f42a 100644
--- a/infra/bots/recipe_modules/env/__init__.py
+++ b/infra/bots/recipe_modules/env/__init__.py
@@ -4,6 +4,6 @@
DEPS = [
- 'recipe_engine/step',
+ 'recipe_engine/context',
]
diff --git a/infra/bots/recipe_modules/env/api.py b/infra/bots/recipe_modules/env/api.py
index 8060a0f946..ea9ed523a8 100644
--- a/infra/bots/recipe_modules/env/api.py
+++ b/infra/bots/recipe_modules/env/api.py
@@ -8,7 +8,7 @@ from recipe_engine import recipe_api
class EnvApi(recipe_api.RecipeApi):
def __call__(self, env_dict):
- env = self.m.step.get_from_context('env', {})
+ env = self.m.context.env
# If PATH is defined in both, merge them together, merging default_env into
# path by replacing %(PATH)s
upstream_path = env.get('PATH', '')
@@ -17,4 +17,4 @@ class EnvApi(recipe_api.RecipeApi):
if upstream_path and my_path and upstream_path != my_path:
env['PATH'] = upstream_path.replace(r'%(PATH)s', my_path)
- return self.m.step.context({'env': env})
+ return self.m.context(env=env)
diff --git a/infra/bots/recipe_modules/env/example.py b/infra/bots/recipe_modules/env/example.py
index a22899b576..d53ab57973 100644
--- a/infra/bots/recipe_modules/env/example.py
+++ b/infra/bots/recipe_modules/env/example.py
@@ -5,6 +5,7 @@
DEPS = [
'env',
+ 'recipe_engine/context',
'recipe_engine/step',
]
@@ -15,7 +16,7 @@ def RunSteps(api):
api.step('2', cmd=['echo', 'hi'])
path = 'mypath:%(PATH)s'
- with api.step.context({'env': {'PATH': path}}):
+ with api.context(env={'PATH': path}):
api.step('3', cmd=['echo', 'hi'])
with api.env({'PATH': '%(PATH)s:otherpath'}):
api.step('4', cmd=['echo', 'hi'])
diff --git a/infra/bots/recipe_modules/flavor/__init__.py b/infra/bots/recipe_modules/flavor/__init__.py
index f4176820f8..a5ef0640e3 100644
--- a/infra/bots/recipe_modules/flavor/__init__.py
+++ b/infra/bots/recipe_modules/flavor/__init__.py
@@ -7,6 +7,7 @@ DEPS = [
'build/file',
'builder_name_schema',
'depot_tools/bot_update',
+ 'recipe_engine/context',
'recipe_engine/path',
'recipe_engine/platform',
'recipe_engine/properties',
diff --git a/infra/bots/recipe_modules/flavor/flutter_flavor.py b/infra/bots/recipe_modules/flavor/flutter_flavor.py
index 0f0302b20e..6b95cb8160 100644
--- a/infra/bots/recipe_modules/flavor/flutter_flavor.py
+++ b/infra/bots/recipe_modules/flavor/flutter_flavor.py
@@ -20,7 +20,7 @@ class FlutterFlavorUtils(default_flavor.DefaultFlavorUtils):
extra_config = self.m.vars.builder_cfg.get('extra_config', '')
out_dir = configuration
- with self.m.step.context({'cwd': flutter_dir}):
+ with self.m.context(cwd=flutter_dir):
# Runhook to generate the gn binary in buildtools.
self.m.run(
self.m.step,
diff --git a/infra/bots/recipe_modules/flavor/gn_android_flavor.py b/infra/bots/recipe_modules/flavor/gn_android_flavor.py
index 095a82c1d3..1ff8b8c10c 100644
--- a/infra/bots/recipe_modules/flavor/gn_android_flavor.py
+++ b/infra/bots/recipe_modules/flavor/gn_android_flavor.py
@@ -24,11 +24,11 @@ class GNAndroidFlavorUtils(default_flavor.DefaultFlavorUtils):
tmp_dir = self.m.vars.android_data_dir)
def _run(self, title, *cmd, **kwargs):
- with self.m.step.context({'cwd': self.m.vars.skia_dir}):
+ with self.m.context(cwd=self.m.vars.skia_dir):
return self.m.run(self.m.step, title, cmd=list(cmd), **kwargs)
def _py(self, title, script, infra_step=True):
- with self.m.step.context({'cwd': self.m.vars.skia_dir}):
+ with self.m.context(cwd=self.m.vars.skia_dir):
return self.m.run(self.m.python, title, script=script,
infra_step=infra_step)
diff --git a/infra/bots/recipe_modules/flavor/gn_chromebook_flavor.py b/infra/bots/recipe_modules/flavor/gn_chromebook_flavor.py
index c004d9971e..3cf2cf19d1 100644
--- a/infra/bots/recipe_modules/flavor/gn_chromebook_flavor.py
+++ b/infra/bots/recipe_modules/flavor/gn_chromebook_flavor.py
@@ -135,13 +135,8 @@ class GNChromebookFlavorUtils(gn_flavor.GNFlavorUtils):
ninja = 'ninja.exe' if 'Win' in os else 'ninja'
gn = self.m.vars.skia_dir.join('bin', gn)
- context = {
- 'cwd': self.m.vars.skia_dir,
- 'env': {
- 'LD_LIBRARY_PATH': sysroot_dir.join('lib'),
- }
- }
- with self.m.step.context(context):
+ with self.m.context(cwd=self.m.vars.skia_dir,
+ env={'LD_LIBRARY_PATH': sysroot_dir.join('lib')}):
self._py('fetch-gn', self.m.vars.skia_dir.join('bin', 'fetch-gn'))
self._run('gn gen', [gn, 'gen', self.out_dir, '--args=' + gn_args])
self._run('ninja', [ninja, '-C', self.out_dir, 'nanobench', 'dm'])
diff --git a/infra/bots/recipe_modules/flavor/gn_flavor.py b/infra/bots/recipe_modules/flavor/gn_flavor.py
index 744cc5a1ce..1b243717a5 100644
--- a/infra/bots/recipe_modules/flavor/gn_flavor.py
+++ b/infra/bots/recipe_modules/flavor/gn_flavor.py
@@ -127,7 +127,7 @@ class GNFlavorUtils(default_flavor.DefaultFlavorUtils):
ninja = 'ninja.exe' if 'Win' in os else 'ninja'
gn = self.m.vars.skia_dir.join('bin', gn)
- with self.m.step.context({'cwd': self.m.vars.skia_dir}):
+ with self.m.context(cwd=self.m.vars.skia_dir):
self._py('fetch-gn', self.m.vars.skia_dir.join('bin', 'fetch-gn'))
self._run('gn gen', [gn, 'gen', self.out_dir, '--args=' + gn_args])
self._run('ninja', [ninja, '-C', self.out_dir])
@@ -171,12 +171,12 @@ class GNFlavorUtils(default_flavor.DefaultFlavorUtils):
# Convert path objects or placeholders into strings such that they can
# be passed to symbolize_stack_trace.py
args = [self.m.vars.slave_dir] + [str(x) for x in cmd]
- with self.m.step.context({'cwd': self.m.vars.skia_dir, 'env': env}):
+ with self.m.context(cwd=self.m.vars.skia_dir, env=env):
self._py('symbolized %s' % name,
self.module.resource('symbolize_stack_trace.py'),
args=args,
infra_step=False)
else:
- with self.m.step.context({'env': env}):
+ with self.m.context(env=env):
self._run(name, cmd)
diff --git a/infra/bots/recipe_modules/flavor/pdfium_flavor.py b/infra/bots/recipe_modules/flavor/pdfium_flavor.py
index 84645f2720..7c34a3299d 100644
--- a/infra/bots/recipe_modules/flavor/pdfium_flavor.py
+++ b/infra/bots/recipe_modules/flavor/pdfium_flavor.py
@@ -17,7 +17,7 @@ class PDFiumFlavorUtils(default_flavor.DefaultFlavorUtils):
pdfium_dir = self.m.vars.checkout_root.join('pdfium')
# Runhook to generate the gn binary in buildtools.
- with self.m.step.context({'cwd': pdfium_dir}):
+ with self.m.context(cwd=pdfium_dir):
self.m.run(
self.m.step,
'runhook',
@@ -45,7 +45,7 @@ class PDFiumFlavorUtils(default_flavor.DefaultFlavorUtils):
env = self.m.step.get_from_context('env', {})
env['CHROMIUM_BUILDTOOLS_PATH'] = str(pdfium_dir.join('buildtools'))
- with self.m.step.context({'env': env}):
+ with self.m.context(env=env):
self.m.run(
self.m.step,
'gn_gen',
diff --git a/infra/bots/recipe_modules/infra/__init__.py b/infra/bots/recipe_modules/infra/__init__.py
index ba20b52f95..94aa82aa7b 100644
--- a/infra/bots/recipe_modules/infra/__init__.py
+++ b/infra/bots/recipe_modules/infra/__init__.py
@@ -3,6 +3,7 @@
# found in the LICENSE file.
DEPS = [
+ 'recipe_engine/context',
'recipe_engine/step',
'run',
'vars',
diff --git a/infra/bots/recipe_modules/infra/api.py b/infra/bots/recipe_modules/infra/api.py
index 4eb3aed2a8..0a4784267a 100644
--- a/infra/bots/recipe_modules/infra/api.py
+++ b/infra/bots/recipe_modules/infra/api.py
@@ -39,7 +39,7 @@ class InfraApi(recipe_api.RecipeApi):
"""Print the Go version."""
env = self.m.step.get_from_context('env', {})
env.update(self.go_env)
- with self.m.step.context({'env': env}):
+ with self.m.context(env=env):
self.m.run(
self.m.step,
'go version',
@@ -57,7 +57,7 @@ class InfraApi(recipe_api.RecipeApi):
self.go_version()
env = self.m.step.get_from_context('env', {})
env.update(self.go_env)
- with self.m.step.context({'env': env}):
+ with self.m.context(env=env):
self.m.run.with_retry(
self.m.step,
'update go pkgs',
diff --git a/infra/bots/recipe_modules/run/example.py b/infra/bots/recipe_modules/run/example.py
index dd4ddcb7ec..162f6792a8 100644
--- a/infra/bots/recipe_modules/run/example.py
+++ b/infra/bots/recipe_modules/run/example.py
@@ -4,6 +4,7 @@
DEPS = [
+ 'recipe_engine/context',
'recipe_engine/path',
'recipe_engine/properties',
'recipe_engine/step',
@@ -36,7 +37,7 @@ def RunSteps(api):
api.run.rmtree('mydir')
# Merge PATHs.
- with api.step.context({'env': {'PATH': 'mydir:%(PATH)s'}}):
+ with api.context(env={'PATH': 'mydir:%(PATH)s'}):
api.run(api.step, 'env', cmd=['env'])
# Copy build products.
diff --git a/infra/bots/recipe_modules/swarming/__init__.py b/infra/bots/recipe_modules/swarming/__init__.py
index 3e05b02b1f..fbd0c006cf 100644
--- a/infra/bots/recipe_modules/swarming/__init__.py
+++ b/infra/bots/recipe_modules/swarming/__init__.py
@@ -8,6 +8,7 @@ DEPS = [
'build/swarming',
'build/swarming_client',
'depot_tools/depot_tools',
+ 'recipe_engine/context',
'recipe_engine/json',
'recipe_engine/path',
'recipe_engine/properties',
diff --git a/infra/bots/recipe_modules/swarming/api.py b/infra/bots/recipe_modules/swarming/api.py
index 81b05e0f82..35dddcf507 100644
--- a/infra/bots/recipe_modules/swarming/api.py
+++ b/infra/bots/recipe_modules/swarming/api.py
@@ -44,7 +44,7 @@ class SkiaSwarmingApi(recipe_api.RecipeApi):
depot_tools_path = self.m.depot_tools.package_repo_resource()
env = {'PATH': self.m.path.pathsep.join([
str(depot_tools_path), '%(PATH)s'])}
- with self.m.step.context({'env': env}):
+ with self.m.context(env=env):
self.m.step('download luci-go linux',
['download_from_google_storage', '--no_resume',
'--platform=linux*', '--no_auth',
diff --git a/infra/bots/recipe_modules/vars/__init__.py b/infra/bots/recipe_modules/vars/__init__.py
index e0e951379f..98c1d3ec2f 100644
--- a/infra/bots/recipe_modules/vars/__init__.py
+++ b/infra/bots/recipe_modules/vars/__init__.py
@@ -5,6 +5,7 @@
DEPS = [
'builder_name_schema',
'depot_tools/bot_update',
+ 'recipe_engine/context',
'recipe_engine/json',
'recipe_engine/path',
'recipe_engine/properties',
diff --git a/infra/bots/recipe_modules/vars/api.py b/infra/bots/recipe_modules/vars/api.py
index dbafc90ac3..e48de5bee6 100644
--- a/infra/bots/recipe_modules/vars/api.py
+++ b/infra/bots/recipe_modules/vars/api.py
@@ -28,7 +28,7 @@ class SkiaVarsApi(recipe_api.RecipeApi):
self.slave_dir = self.m.path['start_dir']
self.checkout_root = self.slave_dir
- self.default_env = self.m.step.get_from_context('env', {})
+ self.default_env = self.m.context.env
self.default_env['CHROME_HEADLESS'] = '1'
self.default_env['PATH'] = self.m.path.pathsep.join([
self.default_env.get('PATH', '%(PATH)s'),
diff --git a/infra/bots/recipes/bundle_recipes.py b/infra/bots/recipes/bundle_recipes.py
index d188ee1f42..ef0eccb6cc 100644
--- a/infra/bots/recipes/bundle_recipes.py
+++ b/infra/bots/recipes/bundle_recipes.py
@@ -7,6 +7,7 @@
DEPS = [
+ 'recipe_engine/context',
'recipe_engine/path',
'recipe_engine/properties',
'recipe_engine/shutil',
@@ -18,7 +19,7 @@ def RunSteps(api):
bundle_dir = api.properties['swarm_out_dir'] + '/recipe_bundle'
skia_dir = api.path['start_dir'].join('skia')
recipes_py = api.path['start_dir'].join('skia', 'infra', 'bots', 'recipes.py')
- with api.step.context({'cwd': skia_dir}):
+ with api.context(cwd=skia_dir):
api.step('git init', infra_step=True,
cmd=['git', 'init'])
api.step('git add', infra_step=True,
diff --git a/infra/bots/recipes/compile.py b/infra/bots/recipes/compile.py
index 6b1c61c539..222b25532b 100644
--- a/infra/bots/recipes/compile.py
+++ b/infra/bots/recipes/compile.py
@@ -8,6 +8,7 @@
DEPS = [
'core',
+ 'recipe_engine/context',
'recipe_engine/json',
'recipe_engine/path',
'recipe_engine/platform',
@@ -49,7 +50,7 @@ def RunSteps(api):
try:
for target in build_targets:
- with api.step.context({'env': env}):
+ with api.context(env=env):
api.flavor.compile(target)
api.run.copy_build_products(
api.flavor.out_dir,
diff --git a/infra/bots/recipes/ct_skps.py b/infra/bots/recipes/ct_skps.py
index 83bbf10243..0abdd8f7fd 100644
--- a/infra/bots/recipes/ct_skps.py
+++ b/infra/bots/recipes/ct_skps.py
@@ -9,6 +9,7 @@ import math
DEPS = [
'build/file',
'depot_tools/gsutil',
+ 'recipe_engine/context',
'recipe_engine/json',
'recipe_engine/path',
'recipe_engine/properties',
@@ -213,7 +214,7 @@ def RunSteps(api):
gs_dest_dir = 'ct/%s/%d/%02d/%02d/%02d/' % (
ct_page_type, utc.year, utc.month, utc.day, utc.hour)
for json_output in api.file.listdir('output dir', output_dir):
- with api.step.context({'env': env}):
+ with api.context(env=env):
api.gsutil.upload(
name='upload json output',
source=output_dir.join(json_output),
diff --git a/infra/bots/recipes/housekeeper.py b/infra/bots/recipes/housekeeper.py
index af2ad4da82..5d6a5f9119 100644
--- a/infra/bots/recipes/housekeeper.py
+++ b/infra/bots/recipes/housekeeper.py
@@ -7,6 +7,7 @@
DEPS = [
'depot_tools/bot_update',
+ 'recipe_engine/context',
'recipe_engine/path',
'recipe_engine/properties',
'recipe_engine/python',
@@ -25,7 +26,7 @@ def RunSteps(api):
# TODO(borenet): Detect static initializers?
- with api.step.context({'cwd': cwd}):
+ with api.context(cwd=cwd):
gsutil_path = api.bot_update._module.PACKAGE_REPO_ROOT.join('gsutil.py')
if not api.vars.is_trybot:
api.run(
diff --git a/infra/bots/recipes/infra.py b/infra/bots/recipes/infra.py
index 2c0222bdff..5482a7fb84 100644
--- a/infra/bots/recipes/infra.py
+++ b/infra/bots/recipes/infra.py
@@ -7,6 +7,7 @@
DEPS = [
+ 'recipe_engine/context',
'recipe_engine/path',
'recipe_engine/properties',
'recipe_engine/step',
@@ -23,7 +24,7 @@ def RunSteps(api):
api.infra.update_go_deps()
# Run the infra tests.
- with api.step.context({'cwd': api.vars.skia_dir, 'env': api.infra.go_env}):
+ with api.context(cwd=api.vars.skia_dir, env=api.infra.go_env):
api.step('infra_tests', cmd=['make', '-C', 'infra/bots', 'test'])
diff --git a/infra/bots/recipes/recreate_skps.py b/infra/bots/recipes/recreate_skps.py
index c697bf19e6..b789975cd1 100644
--- a/infra/bots/recipes/recreate_skps.py
+++ b/infra/bots/recipes/recreate_skps.py
@@ -9,6 +9,7 @@
DEPS = [
'build/file',
'depot_tools/gclient',
+ 'recipe_engine/context',
'recipe_engine/path',
'recipe_engine/properties',
'recipe_engine/python',
@@ -89,13 +90,13 @@ def RunSteps(api):
src_dir = api.vars.checkout_root.join('src')
out_dir = src_dir.join('out', 'Release')
- with api.step.context({'cwd': src_dir}):
+ with api.context(cwd=src_dir):
# Call GN.
platform = 'linux64' # This bot only runs on linux; don't bother checking.
gn = src_dir.join('buildtools', platform, 'gn')
gn_env = {'CPPFLAGS': '-DSK_ALLOW_CROSSPROCESS_PICTUREIMAGEFILTERS=1',
'GYP_GENERATORS': 'ninja'}
- with api.step.context({'env': gn_env}):
+ with api.context(env=gn_env):
api.run(api.step, 'GN', cmd=[gn, 'gen', out_dir])
# Build Chrome.
@@ -115,7 +116,7 @@ def RunSteps(api):
'--target_dir', output_dir]
if 'Canary' not in api.properties['buildername']:
cmd.append('--upload_to_partner_bucket')
- with api.step.context({'cwd': api.vars.skia_dir}):
+ with api.context(cwd=api.vars.skia_dir):
api.run(api.step, 'Recreate SKPs', cmd=cmd)
# Upload the SKPs.
@@ -128,8 +129,7 @@ def RunSteps(api):
'--target_dir', output_dir,
'--gitcookies', str(update_skps_gitcookies)]
with gitcookies_auth(api, UPDATE_SKPS_KEY):
- with api.step.context({'cwd': api.vars.skia_dir,
- 'env': api.infra.go_env}):
+ with api.context(cwd=api.vars.skia_dir, env=api.infra.go_env):
api.run(api.step, 'Upload SKPs', cmd=cmd)
diff --git a/infra/bots/recipes/skpbench.py b/infra/bots/recipes/skpbench.py
index c59864b8a8..08b60d9b23 100644
--- a/infra/bots/recipes/skpbench.py
+++ b/infra/bots/recipes/skpbench.py
@@ -12,6 +12,7 @@ import calendar
DEPS = [
'build/file',
'core',
+ 'recipe_engine/context',
'recipe_engine/path',
'recipe_engine/properties',
'recipe_engine/python',
@@ -25,7 +26,7 @@ DEPS = [
def _run(api, title, *cmd, **kwargs):
- with api.step.context({'cwd': api.vars.skia_dir}):
+ with api.context(cwd=api.vars.skia_dir):
return api.run(api.step, title, cmd=list(cmd), **kwargs)
diff --git a/infra/bots/recipes/test.py b/infra/bots/recipes/test.py
index 27bc3017a0..9b709f0f55 100644
--- a/infra/bots/recipes/test.py
+++ b/infra/bots/recipes/test.py
@@ -11,6 +11,7 @@ DEPS = [
'core',
'env',
'flavor',
+ 'recipe_engine/context',
'recipe_engine/json',
'recipe_engine/path',
'recipe_engine/platform',
@@ -723,11 +724,11 @@ def test_steps(api):
def RunSteps(api):
api.core.setup()
- env = api.step.get_from_context('env', {})
+ env = {}
if 'iOS' in api.vars.builder_name:
env['IOS_BUNDLE_ID'] = 'com.google.dm'
env['IOS_MOUNT_POINT'] = api.vars.slave_dir.join('mnt_iosdevice')
- with api.step.context({'env': env}):
+ with api.context(env=env):
try:
api.flavor.install_everything()
test_steps(api)
diff --git a/infra/bots/recipes/upload_nano_results.py b/infra/bots/recipes/upload_nano_results.py
index 8d917ddaf1..20a723b093 100644
--- a/infra/bots/recipes/upload_nano_results.py
+++ b/infra/bots/recipes/upload_nano_results.py
@@ -8,6 +8,7 @@
DEPS = [
'build/file',
+ 'recipe_engine/context',
'recipe_engine/path',
'recipe_engine/properties',
'recipe_engine/step',
@@ -22,7 +23,7 @@ def RunSteps(api):
now = api.time.utcnow()
src_path = api.path['start_dir'].join(
'perfdata', builder_name, 'data')
- with api.step.context({'cwd': src_path}):
+ with api.context(cwd=src_path):
results = api.file.glob(
'find results',
src_path.join('*.json'),