Skip to content

Commit c1ca916

Browse files
committed
tests/integration: Add test for run command failure exit code
Test is added to confirm that `run` command forwards non-zero failure exit code. Signed-off-by: Monika Kairaityte <monika@kibit.lt>
1 parent 256b51c commit c1ca916

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

tests/integration/build_fail_multi/test_podman_compose_build_fail_multi.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,3 +51,26 @@ def test_push_command_fail(self) -> None:
5151
compose_yaml_path(),
5252
"down",
5353
])
54+
55+
def test_run_command_fail(self) -> None:
56+
# test that run command is able to return other than "0" return code
57+
try:
58+
output, error = self.run_subprocess_assert_returncode(
59+
[
60+
podman_compose_path(),
61+
"-f",
62+
compose_yaml_path(),
63+
"run",
64+
"bad",
65+
],
66+
expected_returncode=125,
67+
)
68+
self.assertIn("RUN false", str(output))
69+
self.assertIn("while running runtime: exit status 1", str(error))
70+
finally:
71+
self.run_subprocess_assert_returncode([
72+
podman_compose_path(),
73+
"-f",
74+
compose_yaml_path(),
75+
"down",
76+
])

0 commit comments

Comments
 (0)