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

Side by Side Diff: recipes/engine_tests/step_stack_exhaustion.py

Issue 2885023004: [step_runner] Add a Placeholder Exception step when rendering placeholders raises a StepFailure. (Closed)
Patch Set: ... actually add expectation 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 unified diff | Download patch
OLDNEW
(Empty)
1 # Copyright 2015 The LUCI Authors. All rights reserved.
tandrii(chromium) 2017/05/17 08:00:18 s/2015/2017
iannucci 2017/05/17 08:06:51 Done.
2 # Use of this source code is governed under the Apache License, Version 2.0
3 # that can be found in the LICENSE file.
4
5 """Tests that step_data can accept multiple specs at once."""
6
7 from recipe_engine.util import InputPlaceholder
8 from recipe_engine.recipe_api import StepFailure
9
10 DEPS = [
11 'step',
12 ]
13
14 class BadPlaceholder(InputPlaceholder):
15 def render(self, test):
16 raise StepFailure("EXPLOSION")
17
18
19 def RunSteps(api):
20 try:
21 api.step('innocent step', ['echo', 'some', 'step'])
22
23 ph = BadPlaceholder('name')
24 ph.namespaces = ('fake', 'namespace')
25
26 api.step('bad step', ['echo', ph])
27 finally:
28 api.step.active_result # this will raise a ValueError
tandrii(chromium) 2017/05/17 08:00:18 s/t #/t #/
iannucci 2017/05/17 08:06:51 Done.
29
30 def GenTests(api):
31 yield (
32 api.test('basic') +
33 api.expect_exception('ValueError')
34 )
35
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698