Skip to content

Commit 9fe3038

Browse files
committed
tests/integration: Automate 'build_fail' manual test
Signed-off-by: Monika Kairaityte <[email protected]>
1 parent 0f8348b commit 9fe3038

File tree

2 files changed

+30
-22
lines changed

2 files changed

+30
-22
lines changed

tests/integration/build_fail/README.md

Lines changed: 0 additions & 22 deletions
This file was deleted.
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# SPDX-License-Identifier: GPL-2.0
2+
3+
import os
4+
import unittest
5+
6+
from tests.integration.test_podman_compose import podman_compose_path
7+
from tests.integration.test_podman_compose import test_path
8+
from tests.integration.test_utils import RunSubprocessMixin
9+
10+
11+
def compose_yaml_path():
12+
""" "Returns the path to the compose file used for this test module"""
13+
base_path = os.path.join(test_path(), "build_fail")
14+
return os.path.join(base_path, "docker-compose.yml")
15+
16+
17+
class TestComposeBuildFail(unittest.TestCase, RunSubprocessMixin):
18+
def test_build_fail(self):
19+
output, error = self.run_subprocess_assert_returncode(
20+
[
21+
podman_compose_path(),
22+
"-f",
23+
compose_yaml_path(),
24+
"build",
25+
],
26+
expected_returncode=127,
27+
)
28+
self.assertIn("RUN this_command_does_not_exist", str(output))
29+
self.assertIn("this_command_does_not_exist: not found", str(error))
30+
self.assertIn("while running runtime: exit status 127", str(error))

0 commit comments

Comments
 (0)