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

Unified Diff: recipes/engine_tests/missing_start_dir.py

Issue 2885293003: [step_runner] do not immediately bail when START_DIR is gone. (Closed)
Patch Set: whitespace 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/missing_start_dir.expected/basic.json » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: recipes/engine_tests/missing_start_dir.py
diff --git a/recipes/engine_tests/missing_start_dir.py b/recipes/engine_tests/missing_start_dir.py
new file mode 100644
index 0000000000000000000000000000000000000000..bb28f0fd3f119ef492fdf04cf99b37e999b907cd
--- /dev/null
+++ b/recipes/engine_tests/missing_start_dir.py
@@ -0,0 +1,27 @@
+# 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 deleting the current working directory doesn't immediately fail."""
+
+DEPS = [
+ 'step',
+ 'path',
+]
+
+
+def RunSteps(api):
+ api.step('innocent step', ['bash', '-c', "echo some step"])
+ api.step('nuke it', ['rm', '-rf', api.path['start_dir']])
+
+ try:
+ api.step('bash needs cwd', ['bash', '-c', "echo fail"])
+ assert True
+ except api.step.StepFailure: # pragma: no cover
+ assert False
+
+ api.step('python does not', ['python', '-c', 'print "hi"'])
+
+
+def GenTests(api):
+ yield api.test('basic')
« no previous file with comments | « recipe_engine/step_runner.py ('k') | recipes/engine_tests/missing_start_dir.expected/basic.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698