Skip to content

Fix DockerEnvironment unit tests by removing eager Docker dependency#374

Merged
vik-rant merged 2 commits intodevfrom
openclaw/fix-docker-env-unit-tests
Feb 25, 2026
Merged

Fix DockerEnvironment unit tests by removing eager Docker dependency#374
vik-rant merged 2 commits intodevfrom
openclaw/fix-docker-env-unit-tests

Conversation

@AgentDosaku
Copy link
Collaborator

@AgentDosaku AgentDosaku commented Feb 25, 2026

Summary

  • make DockerEnvironment create its Docker client lazily (in setup())
  • add optional client_factory constructor arg for testability/injection
  • keep runtime behavior the same for normal usage

Why

Unit tests should not require a running Docker daemon. Previously, DockerEnvironment.init eagerly called docker.from_env(), causing unit tests to fail in environments without Docker.

Validation

  • pytest -q tests/unit/mindtrace/cluster/test_docker_env.py (15 passed)
  • ds test --unit (4174 passed, 14 skipped)

@vik-rant vik-rant merged commit f1796d1 into dev Feb 25, 2026
4 checks passed
@vik-rant vik-rant deleted the openclaw/fix-docker-env-unit-tests branch February 25, 2026 18:09
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.

2 participants