Skip to content

Commit

Permalink
Skip running test_docker on macos due to upstream bug (#4358)
Browse files Browse the repository at this point in the history
  • Loading branch information
ssbarnea authored Jan 13, 2025
1 parent ec3e08d commit 097f771
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions tests/integration/test_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@
# DEALINGS IN THE SOFTWARE.
from __future__ import annotations

from typing import TYPE_CHECKING, TypedDict
import sys

from pathlib import Path
from typing import TypedDict

import pytest

Expand All @@ -30,10 +33,6 @@
from tests.conftest import mac_on_gh # pylint:disable=C0411


if TYPE_CHECKING:
from pathlib import Path


@pytest.fixture(name="scenario_to_test")
def fixture_scenario_to_test(request): # type: ignore[no-untyped-def] # noqa: ANN001, ANN201, D103
return request.param
Expand Down Expand Up @@ -323,6 +322,10 @@ def test_podman(monkeypatch: pytest.MonkeyPatch, test_fixture_dir: Path) -> None


@mac_on_gh
@pytest.mark.skipif(
sys.platform == "darwin",
reason="Bug https://github.com/ansible-collections/community.docker/issues/660",
)
def test_docker(monkeypatch: pytest.MonkeyPatch, test_fixture_dir: Path) -> None:
"""Execute Docker scenario.
Expand All @@ -331,6 +334,13 @@ def test_docker(monkeypatch: pytest.MonkeyPatch, test_fixture_dir: Path) -> None
test_fixture_dir: Path to the test fixture directory.
"""
monkeypatch.chdir(test_fixture_dir)
# This trick should force Docker to use its own backend on macOS even with Podman's Docker Extensions enabled,
# but community.docker collection is not yet able to read it due:
# https://github.com/ansible-collections/community.docker/issues/660
docker_socket = Path("~/Library/Containers/com.docker.docker/Data/docker-cli.sock").expanduser()
if docker_socket.exists():
monkeypatch.setenv("DOCKER_SOCKET", docker_socket.as_posix())

command = ["molecule", "test", "--scenario-name", "docker"]
assert run_command(command).returncode == 0

Expand Down

0 comments on commit 097f771

Please sign in to comment.