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

Unified 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: fix nits 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « recipe_engine/step_runner.py ('k') | recipes/engine_tests/step_stack_exhaustion.expected/basic.json » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: recipes/engine_tests/step_stack_exhaustion.py
diff --git a/recipes/engine_tests/step_stack_exhaustion.py b/recipes/engine_tests/step_stack_exhaustion.py
new file mode 100644
index 0000000000000000000000000000000000000000..1e939efaa7b96d179dc4ba4a0233f185d33ee7fd
--- /dev/null
+++ b/recipes/engine_tests/step_stack_exhaustion.py
@@ -0,0 +1,35 @@
+# Copyright 2017 The LUCI Authors. All rights reserved.
+# Use of this source code is governed under the Apache License, Version 2.0
+# that can be found in the LICENSE file.
+
+"""Tests that step_data can accept multiple specs at once."""
+
+from recipe_engine.util import InputPlaceholder
+from recipe_engine.recipe_api import StepFailure
+
+DEPS = [
+ 'step',
+]
+
+class BadPlaceholder(InputPlaceholder):
+ def render(self, test):
+ raise StepFailure("EXPLOSION")
+
+
+def RunSteps(api):
+ try:
+ api.step('innocent step', ['echo', 'some', 'step'])
+
+ ph = BadPlaceholder('name')
+ ph.namespaces = ('fake', 'namespace')
+
+ api.step('bad step', ['echo', ph])
+ finally:
+ api.step.active_result # this will raise a ValueError
+
+def GenTests(api):
+ yield (
+ api.test('basic') +
+ api.expect_exception('ValueError')
+ )
+
« no previous file with comments | « recipe_engine/step_runner.py ('k') | recipes/engine_tests/step_stack_exhaustion.expected/basic.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698