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

Side by Side Diff: recipe_modules/generator_script/example.py

Issue 1906323003: recipe engine: extract infra-specific paths out of the engine (Closed) Base URL: https://github.com/luci/recipes-py.git@master
Patch Set: tmp Created 4 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 unified diff | Download patch
« no previous file with comments | « no previous file | recipe_modules/generator_script/example.expected/always_run.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 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 from recipe_engine.recipe_api import Property 5 from recipe_engine.recipe_api import Property
6 6
7 DEPS = [ 7 DEPS = [
8 'generator_script', 8 'generator_script',
9 'json', 9 'json',
10 'path', 10 'path',
11 'properties', 11 'properties',
12 'step', 12 'step',
13 ] 13 ]
14 14
15 PROPERTIES = { 15 PROPERTIES = {
16 'script_name': Property(kind=str), 16 'script_name': Property(kind=str),
17 'script_env': Property(default=None, kind=dict), 17 'script_env': Property(default=None, kind=dict),
18 } 18 }
19 19
20 def RunSteps(api, script_name, script_env): 20 def RunSteps(api, script_name, script_env):
21 api.path['checkout'] = api.path['slave_build'] 21 api.path['checkout'] = api.path['tmp'].join('checkout')
22 script_name = api.properties['script_name'] 22 script_name = api.properties['script_name']
23 script_env = api.properties.get('script_env') 23 script_env = api.properties.get('script_env')
24 api.generator_script(script_name, env=script_env) 24 api.generator_script(script_name, env=script_env)
25 25
26 def GenTests(api): 26 def GenTests(api):
27 yield ( 27 yield (
28 api.test('basic') + 28 api.test('basic') +
29 api.properties(script_name="bogus") + 29 api.properties(script_name="bogus") +
30 api.generator_script( 30 api.generator_script(
31 'bogus', 31 'bogus',
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 ) 73 )
74 74
75 yield ( 75 yield (
76 api.test('malformed_command') + 76 api.test('malformed_command') +
77 api.properties(script_name='malformed.py') + 77 api.properties(script_name='malformed.py') +
78 api.generator_script( 78 api.generator_script(
79 'malformed.py', 79 'malformed.py',
80 {'name': 'run', 'cmd': ['echo', 'there are', 4, 'cows']}) + 80 {'name': 'run', 'cmd': ['echo', 'there are', 4, 'cows']}) +
81 api.expect_exception('AssertionError') 81 api.expect_exception('AssertionError')
82 ) 82 )
OLDNEW
« no previous file with comments | « no previous file | recipe_modules/generator_script/example.expected/always_run.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698