Skip to content

Guard unit tests against real Docker daemon and stub start_all_agents - #4831

Open
theluckystrike wants to merge 1 commit into
Abilityai:mainfrom
theluckystrike:fix/4802-unit-no-real-docker
Open

theluckystrike wants to merge 1 commit into
Abilityai:mainfrom
theluckystrike:fix/4802-unit-no-real-docker

Conversation

@theluckystrike

Copy link
Copy Markdown

Fixes #4802.

tests/unit/_ent695_world.py::install_executor_seams stubbed docker_utils container helpers and world.create, but left system_service.start_all_agents pointing at the real implementation. While test_ent1030_gates.py patched start_all_agents locally, sibling tests using install_executor_seams (such as test_ent1030_grants.py, test_ent1030_seats.py, and test_ent695_apply_route.py) could reach start_agent_internal and create a real agent-acme-lead container whenever a Docker daemon was reachable.

Changes

  • Stub system_service.start_all_agents inside install_executor_seams in tests/unit/_ent695_world.py to delegate to world.docker.start (tests can still override it with monkeypatch).
  • Add an autouse _guard_no_real_docker fixture in tests/unit/conftest.py that replaces docker.from_env and docker.DockerClient with a guard raising RuntimeError if any unit test tries to open a real Docker client.
  • Add tests/unit/test_4802_no_real_docker.py verifying the real-Docker guard.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug(tests): the unit suite creates a real agent container when a Docker daemon is reachable

1 participant