Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(865)

Unified Diff: recipe_modules/context/example.py

Issue 2909983003: [loader] Make recipe engine support examples/ module subdir (Closed)
Patch Set: Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « recipe_engine/unittests/run_test.py ('k') | recipe_modules/context/example.expected/basic.json » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: recipe_modules/context/example.py
diff --git a/recipe_modules/context/example.py b/recipe_modules/context/example.py
deleted file mode 100644
index 4a9c13ff8b3d29e8cca3211f3db6e811879cbd08..0000000000000000000000000000000000000000
--- a/recipe_modules/context/example.py
+++ /dev/null
@@ -1,44 +0,0 @@
-# Copyright 2017 The LUCI Authors. All rights reserved.
-# Use of this source code is governed under the Apache License, Version 2.0
-# that can be found in the LICENSE file.
-
-from recipe_engine import recipe_api, config
-
-DEPS = [
- 'context',
- 'path',
- 'step',
-]
-
-
-def RunSteps(api):
- api.step('default step', ['bash', '-c', 'echo default!'])
-
- noop_context = {}
- with api.context(**noop_context):
- # nothing happens! this is exactly the same as above, but this optimization
- # is helpful when recipes need to calculate contextual values.
- api.step('default step', ['bash', '-c', 'echo default!'])
-
- # can change cwd
- api.step('mk subdir', ['mkdir', 'subdir'])
- with api.context(cwd=api.path['start_dir'].join('subdir')):
- api.step('subdir step', ['bash', '-c', 'pwd'])
- api.step('other subdir step', ['bash', '-c', 'echo hi again!'])
-
- # can set envvars
- with api.context(env={"HELLO": "WORLD", "HOME": None}):
- api.step('env step', ['bash', '-c', 'echo $HELLO; echo $HOME'])
-
- # can increment nest level... note that this is a low level api, prefer
- # api.step.nest instead:
- # YES:
- with api.step.nest('nested'):
- api.step('properly indented', ['bash', '-c', 'echo yay!'])
- # AVOID:
- with api.context(increment_nest_level=True):
- api.step('indented with wrong name', ['bash', '-c', 'echo indent?'])
-
-
-def GenTests(api):
- yield api.test('basic')
« no previous file with comments | « recipe_engine/unittests/run_test.py ('k') | recipe_modules/context/example.expected/basic.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698