Skip to content

Commit 59d1968

Browse files
committed
chore: add mac integration skips
1 parent 776c602 commit 59d1968

File tree

4 files changed

+25
-2
lines changed

4 files changed

+25
-2
lines changed

Makefile

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,8 @@ EXTRAS_LIST := $(shell $(PYTHON) scripts/list_arm_extras.py)
1919

2020
install: ## Set up the project for development
2121
ifeq ($(IS_ARM),$(ARCH))
22-
@echo "Detected ARM architecture, skipping 'db2' extra (ibm-db is incompatible)"
2322
poetry install $(foreach extra,$(EXTRAS_LIST),--extras $(extra))
2423
else
25-
@echo "Detected non-ARM architecture, installing all extras"
2624
poetry install --all-extras
2725
endif
2826
poetry run pre-commit install

core/tests/test_core_registry.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,13 @@
1818
from testcontainers.core.waiting_utils import wait_container_is_ready
1919

2020
from testcontainers.registry import DockerRegistryContainer
21+
from testcontainers.core.utils import is_mac
2122

2223

24+
@pytest.mark.skipif(
25+
is_mac(),
26+
reason="Docker Desktop on macOS does not support insecure private registries without daemon reconfiguration",
27+
)
2328
def test_missing_on_private_registry(monkeypatch):
2429
username = "user"
2530
password = "pass"
@@ -41,6 +46,10 @@ def test_missing_on_private_registry(monkeypatch):
4146
wait_container_is_ready(test_container)
4247

4348

49+
@pytest.mark.skipif(
50+
is_mac(),
51+
reason="Docker Desktop on macOS does not support local insecure registries over HTTP without modifying daemon settings",
52+
)
4453
@pytest.mark.parametrize(
4554
"image,tag,username,password",
4655
[

core/tests/test_docker_in_docker.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
from testcontainers.core.container import DockerContainer
1616
from testcontainers.core.docker_client import DockerClient, LOGGER
1717
from testcontainers.core.utils import inside_container
18+
from testcontainers.core.utils import is_mac
1819
from testcontainers.core.waiting_utils import wait_for_logs
1920

2021

@@ -36,6 +37,7 @@ def _wait_for_dind_return_ip(client, dind):
3637
return docker_host_ip
3738

3839

40+
@pytest.mark.skipif(is_mac(), reason="Docker socket forwarding (socat) is unsupported on Docker Desktop for macOS")
3941
def test_wait_for_logs_docker_in_docker():
4042
# real dind isn't possible (AFAIK) in CI
4143
# forwarding the socket to a container port is at least somewhat the same
@@ -64,6 +66,9 @@ def test_wait_for_logs_docker_in_docker():
6466
not_really_dind.remove()
6567

6668

69+
@pytest.mark.skipif(
70+
is_mac(), reason="Bridge networking and Docker socket forwarding are not supported on Docker Desktop for macOS"
71+
)
6772
def test_dind_inherits_network():
6873
client = DockerClient()
6974
try:
@@ -158,6 +163,9 @@ def test_find_host_network_in_dood() -> None:
158163
assert DockerClient().find_host_network() == os.environ[EXPECTED_NETWORK_VAR]
159164

160165

166+
@pytest.mark.skipif(
167+
is_mac(), reason="Docker socket mounting and container networking do not work reliably on Docker Desktop for macOS"
168+
)
161169
@pytest.mark.skipif(not Path(tcc.ryuk_docker_socket).exists(), reason="No docker socket available")
162170
def test_dood(python_testcontainer_image: str) -> None:
163171
"""

core/tests/test_ryuk.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,14 @@
88
from testcontainers.core.config import testcontainers_config
99
from testcontainers.core.container import Reaper
1010
from testcontainers.core.container import DockerContainer
11+
from testcontainers.core.utils import is_mac
1112
from testcontainers.core.waiting_utils import wait_for_logs
1213

1314

15+
@pytest.mark.skipif(
16+
is_mac(),
17+
reason="Ryuk container reaping is unreliable on Docker Desktop for macOS due to VM-based container lifecycle handling",
18+
)
1419
@pytest.mark.inside_docker_check
1520
def test_wait_for_reaper(monkeypatch: MonkeyPatch):
1621
Reaper.delete_instance()
@@ -41,6 +46,9 @@ def test_wait_for_reaper(monkeypatch: MonkeyPatch):
4146
Reaper.delete_instance()
4247

4348

49+
@pytest.mark.skipif(
50+
is_mac(), reason="Ryuk disabling behavior is unreliable on Docker Desktop for macOS due to Docker socket emulation"
51+
)
4452
@pytest.mark.inside_docker_check
4553
def test_container_without_ryuk(monkeypatch: MonkeyPatch):
4654
Reaper.delete_instance()

0 commit comments

Comments
 (0)