Skip to content

Commit

Permalink
tests/integration: Automate 'build_failed' manual test
Browse files Browse the repository at this point in the history
  • Loading branch information
mokibit committed Jul 8, 2024
1 parent 8cf465e commit c621096
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_utils import RunSubprocessMixin

from .test_podman_compose import podman_compose_path
from .test_podman_compose import test_path


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


class TestComposeBuildFail(unittest.TestCase, RunSubprocessMixin):
def test_build_fail(self):
command_build = [
podman_compose_path(),
"-f",
os.path.join(compose_yaml_path(), "docker-compose.yml"),
"build",
]
output, error = self.run_subprocess_assert_returncode(command_build,
expected_returncode=127)
self.assertTrue("RUN this_command_does_not_exist" in str(output))
self.assertTrue("this_command_does_not_exist: not found" in str(error))
self.assertTrue("while running runtime: exit status 127" in str(error))

0 comments on commit c621096

Please sign in to comment.