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

Unified Diff: recipe_modules/context/examples/full.py

Issue 2985323002: Add support for LUCI_CONTEXT.
Patch Set: Created 3 years, 5 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
Index: recipe_modules/context/examples/full.py
diff --git a/recipe_modules/context/examples/full.py b/recipe_modules/context/examples/full.py
index d86c89c92b32d2563ae46a5a802343dd4f980b53..557175887feac14f116026fcb3311b9942356b55 100644
--- a/recipe_modules/context/examples/full.py
+++ b/recipe_modules/context/examples/full.py
@@ -66,6 +66,15 @@ def RunSteps(api):
with api.context(increment_nest_level=True):
api.step('indented with wrong name', ['bash', '-c', 'echo indent?'])
+ # Can read initial LUCI_CONTEXT value.
+ val = api.context.luci_context['INITIAL']['k']
+ api.step('value in the context', ['echo', val])
+
+ # Can modify it.
+ with api.context(luci_context={'INITIAL': None, 'OTHER': {'k': 'zzz'}}):
+ val = api.context.luci_context['OTHER']['k']
+ api.step('value in the context', ['echo', val])
+
def GenTests(api):
- yield api.test('basic')
+ yield api.test('basic') + api.context.luci_context({'INITIAL': {'k': 'val'}})

Powered by Google App Engine
This is Rietveld 408576698