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

Side by Side Diff: scripts/slave/recipe_modules/step/example.py

Issue 23889036: Refactor the way that TestApi works so that it is actually useful. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/build
Patch Set: rebase Created 7 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 | Annotate | Revision Log
OLDNEW
1 # Copyright 2013 The Chromium Authors. All rights reserved. 1 # Copyright 2013 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 DEPS = [ 5 DEPS = [
6 'step', 6 'step',
7 ] 7 ]
8 8
9 9
10 def GenSteps(api): 10 def GenSteps(api):
11 # We are going to have steps with the same name, so fix it automagically. 11 # We are going to have steps with the same name, so fix it automagically.
12 api.step.auto_resolve_conflicts = True 12 api.step.auto_resolve_conflicts = True
13 13
14 # The api.step object is directly callable. 14 # The api.step object is directly callable.
15 yield api.step('hello', ['echo', 'Hello World']) 15 yield api.step('hello', ['echo', 'Hello World'])
16 yield api.step('hello', ['echo', 'Why hello, there.']) 16 yield api.step('hello', ['echo', 'Why hello, there.'])
17 17
18 # You can also manipulate various aspects of the step, such as env. 18 # You can also manipulate various aspects of the step, such as env.
19 # These are passed straight through to subprocess.Popen. 19 # These are passed straight through to subprocess.Popen.
20 # Also, abusing bash -c in this way is a TERRIBLE IDEA DON'T DO IT. 20 # Also, abusing bash -c in this way is a TERRIBLE IDEA DON'T DO IT.
21 yield api.step('goodbye', ['bash', '-c', 'echo Good bye, $friend.'], 21 yield api.step('goodbye', ['bash', '-c', 'echo Good bye, $friend.'],
22 env={'friend': 'Darth Vader'}) 22 env={'friend': 'Darth Vader'})
23 23
24 24
25 def GenTests(_api): 25 def GenTests(api):
26 yield 'basic', {} 26 yield api.Test('basic')
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698