Skip to content

Commit

Permalink
tests/integration: Automate 'build_fail' manual test
Browse files Browse the repository at this point in the history
Signed-off-by: Monika Kairaityte <monika@kibit.lt>
  • Loading branch information
mokibit committed Jul 8, 2024
1 parent 7a6c9a6 commit 3266f41
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions tests/integration/test_podman_compose_build_fail.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# SPDX-License-Identifier: GPL-2.0

import os
import unittest

from tests.integration.test_podman_compose import podman_compose_path
from tests.integration.test_podman_compose import test_path
from tests.integration.test_utils import RunSubprocessMixin


def compose_yaml_path():
""" "Returns the path to the compose file used for this test module"""
base_path = os.path.join(test_path(), "build_fail")
return os.path.join(base_path, "docker-compose.yml")


class TestComposeBuildFail(unittest.TestCase, RunSubprocessMixin):
def test_build_fail(self):
output, error = self.run_subprocess_assert_returncode(
[
podman_compose_path(),
"-f",
compose_yaml_path(),
"build",
],
expected_returncode=127,
)
self.assertIn("RUN this_command_does_not_exist", str(output))
self.assertIn("this_command_does_not_exist: not found", str(error))
self.assertIn("while running runtime: exit status 127", str(error))

0 comments on commit 3266f41

Please sign in to comment.