Skip to content

fix: skip Docker Hub network calls when Dolt image not cached#2300

Merged
steveyegge merged 1 commit intosteveyegge:mainfrom
PabloLION:fix/skip-uncached-dolt-image
Mar 3, 2026
Merged

fix: skip Docker Hub network calls when Dolt image not cached#2300
steveyegge merged 1 commit intosteveyegge:mainfrom
PabloLION:fix/skip-uncached-dolt-image

Conversation

@PabloLION
Copy link
Contributor

Summary

  • Check for locally cached Docker image before calling dolt.Run(), which contacts Docker Hub even when the image is already present
  • Tests now skip with a helpful docker pull command when the exact image:tag is missing
  • Gates all 4 entry points: StartTestDoltServer, StartIsolatedDoltContainer, EnsureDoltContainerForTestMain, RequireDoltContainer

Fixes #2277

Behavior matrix

Docker Image cached Cache state Result
Stopped Skip: "Docker not available"
Running No Skip: "run docker pull dolthub/dolt-sql-server:1.43.0"
Running Yes Version matches Starts container (no network)
Running Yes Wrong version Skip: "run docker pull dolthub/dolt-sql-server:1.43.0"

Rows 2 and 4 produce the same outcome — docker image inspect checks the exact tag, so a stale cached version won't match.

Test plan

  • Docker stopped → tests skip with "Docker not available" (unchanged)
  • Docker running + exact image cached → container starts normally (no network)
  • Docker running + image not cached → tests skip with pull instruction
  • Docker running + wrong version cached → tests skip with correct version in message
  • go vet ./internal/testutil/ passes
  • go test ./cmd/bd/... -count=1 passes (pre-existing TestCheckTestPollution_NoTestIssues failure unrelated)

🤖 Generated with Claude Code

Check for locally cached Docker image before calling dolt.Run(), which
contacts Docker Hub even when the image is already present. Tests now
skip with a helpful pull command when the exact image:tag is missing.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@PabloLION
Copy link
Contributor Author

Closing in favor of c2888b1 which takes a cleaner approach — merging the image cache check into isDockerAvailable() instead of gating 4 call sites separately. Single point of change, cached result, and the BEADS_SKIP_DOCKER=1 escape hatch is a nice bonus.

@PabloLION PabloLION closed this Mar 3, 2026
@steveyegge steveyegge merged commit 6adf14b into steveyegge:main Mar 3, 2026
8 checks passed
@PabloLION PabloLION deleted the fix/skip-uncached-dolt-image branch March 3, 2026 08:43
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.

tests: skip Docker image pull when image not cached locally

2 participants