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

Side by Side Diff: recipes/example/nested.py

Issue 2245113002: Track step nesting in StreamEngine. (Closed) Base URL: https://github.com/luci/recipes-py@emit-initial-properties
Patch Set: Rebase, comments. Created 4 years, 3 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 unified diff | Download patch
« no previous file with comments | « recipes.py ('k') | recipes/example/nested.expected/basic.json » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2015 The LUCI Authors. All rights reserved. 1 # Copyright 2015 The LUCI Authors. All rights reserved.
2 # Use of this source code is governed under the Apache License, Version 2.0 2 # Use of this source code is governed under the Apache License, Version 2.0
3 # that can be found in the LICENSE file. 3 # that can be found in the LICENSE file.
4 4
5 5
6 DEPS = [ 6 DEPS = [
7 'step', 7 'step',
8 ] 8 ]
9 9
10 10
11 def RunSteps(api): 11 def RunSteps(api):
12 # Nest all steps below this. 12 # Nest all steps below this.
13 with api.step.nest('complicated thing'): 13 with api.step.nest('complicated thing'):
14 with api.step.nest('first part'): 14 with api.step.nest('first part'):
15 api.step('wait a bit', ['sleep', '10']) 15 api.step('wait a bit', ['sleep', '1'])
16 16
17 # Prefix the name without indenting. 17 # Prefix the name without indenting.
18 with api.step.context({'name': 'attempt number'}): 18 with api.step.context({'name': 'attempt number'}):
19 step_result = api.step('one', ['echo', 'herpy']) 19 step_result = api.step('one', ['echo', 'herpy'])
20 assert step_result.step['name'] == 'complicated thing.attempt number.one' 20 assert step_result.step['name'] == 'complicated thing.attempt number.one'
21 api.step('two', ['echo', 'derpy']) 21 api.step('two', ['echo', 'derpy'])
22 22
23 api.step('simple thing', ['sleep', '10']) 23 api.step('simple thing', ['sleep', '1'])
24 24
25 25
26 def GenTests(api): 26 def GenTests(api):
27 yield api.test('basic') 27 yield api.test('basic')
OLDNEW
« no previous file with comments | « recipes.py ('k') | recipes/example/nested.expected/basic.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698