Skip to content

Commit b03bdba

Browse files
authored
Merge pull request #2350 from vladak/commands_terminate_test
check that command sequence is terminated after first failure
2 parents fa5f403 + f8433c8 commit b03bdba

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

tools/src/test/python/test_commands.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,14 @@ def test_run_retcodes(self):
5353
'/bin/true opengrok-master': 0,
5454
'/bin/false opengrok-master': 1}, cmds.retcodes)
5555

56+
@unittest.skipUnless(os.name.startswith("posix"), "requires Unix")
57+
def test_terminate_after_non_zero_code(self):
58+
cmds = Commands(CommandsBase("opengrok-master",
59+
[{"command": ["/bin/false"]},
60+
{"command": ["/bin/true"]}]))
61+
cmds.run()
62+
self.assertEqual({'/bin/false opengrok-master': 1}, cmds.retcodes)
63+
5664
@unittest.skipUnless(os.name.startswith("posix"), "requires Unix")
5765
def test_project_subst(self):
5866
cmds = Commands(CommandsBase("test-subst",

0 commit comments

Comments
 (0)