beads/internal/testutil
Steve Yegge 7cd4246781
fix(test): pin DOCKER_HOST from the active docker context before TestMain swaps HOME (bd-84kos) (#5391)
* fix(test): pin DOCKER_HOST from the active docker context before TestMain swaps HOME (bd-84kos)

cmd/bd's testMainInner points HOME at a temp dir before any test runs,
which hides ~/.docker/config.json — the file holding the docker CLI's
active context. On machines where the daemon is reached via a context
(OrbStack, Docker Desktop's desktop-linux, remote daemons), 'docker
info' then falls back to unix:///var/run/docker.sock and fails, so
every container-gated test SKIPs 'Docker not available' even though
docker works fine in the invoking shell. Skips read as green, so the
proxied parity suites silently stopped running (bit bd-i8qx8).

Add testutil.PinDockerHostFromContext — resolve the active context's
endpoint ('docker context inspect -f {{.Endpoints.docker.Host}}') into
DOCKER_HOST, no-op when DOCKER_HOST is already set or docker is absent
— and call it in testMainInner just before the HOME swap.

Verified on macOS + OrbStack with no DOCKER_HOST in the environment:
TestProxiedServerExternalCreate skips 'Docker not available' on main,
and PASSes against a live container with this change.

* fix(test): harden PinDockerHostFromContext — 5s exec timeout + endpoint-shape check (bd-84kos)

Review hardenings: a pathological docker shim can no longer hang
TestMain (context inspect is local-metadata-only, so 5s is generous),
and a resolved value is only pinned when it is endpoint-shaped
(contains '://') — a shim printing something else degrades to no-op.
2026-08-07 00:32:40 -07:00
..
fixtures fix(ci): get nightly full tests passing (#2835) 2026-03-26 09:52:03 -07:00
integration fix(ci): get nightly full tests passing (#2835) 2026-03-26 09:52:03 -07:00
testdata testutil: migrate test Dolt server from binary-spawning to testcontainers 2026-02-28 21:12:41 -08:00
container_provider.go /{cmd,internal}: pr feedback 2026-04-08 15:03:32 -07:00
container_provider_windows.go /{cmd,internal}: some cleanup 2026-04-08 14:45:18 -07:00
dockercontext.go fix(test): pin DOCKER_HOST from the active docker context before TestMain swaps HOME (bd-84kos) (#5391) 2026-08-07 00:32:40 -07:00
dockercontext_test.go fix(test): pin DOCKER_HOST from the active docker context before TestMain swaps HOME (bd-84kos) (#5391) 2026-08-07 00:32:40 -07:00
git_test_hooks.go Test isolation follow-up: consolidate and guard hooksPath leakage (#2234) (#2237) 2026-03-01 14:41:08 -08:00
testdoltbranch.go fix: materialize local table schemas for branch tests (#4014) 2026-05-19 09:22:35 -07:00
testdoltcommon.go /{.github,docs,engdocs,go,internal,scripts}: bump dolt 2026-07-15 13:14:34 -07:00
testdoltserver.go fix: remove dead 3-way merge config remnants (GH#2353) 2026-03-05 15:57:33 -08:00
testdoltserver_windows.go refactor(testutil): remove StartTestDoltServer/TestDoltServer, add crash detection functions 2026-03-03 09:59:50 -08:00
tmpfs.go style: run gofmt across entire codebase (bd-nmk12) 2026-02-07 19:35:20 -08:00
tmpfs_test.go style: run gofmt across entire codebase (bd-nmk12) 2026-02-07 19:35:20 -08:00