pkg/oci tests abort when Docker is unavailable
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 1.4k
- Forks
- 364
- Avg merge
- 1d 4h
- Merged PRs (30d)
- 84
Description
What happened:
Summary
pkg/oci test execution aborts the whole package in TestMain when Docker is unavailable, so ordinary go test runs fail before any individual tests can be skipped.
Affected Area
pkg/ocipkg/oci/main_test.go
Technical Evidence
pkg/oci/main_test.gounconditionally creates a Docker-backed registry inTestMainviadockertest.NewPool("")andpool.RunWithOptions(...).- Running
go test ./pkg/ocion July 11, 2026 in an environment without/var/run/docker.sockfails with:2026/07/11 03:47:02 Failed to start resource: : dial unix /var/run/docker.sock: connect: no such file or directory FAIL github.com/pipe-cd/pipecd/pkg/oci 15.252s - The package exits through
log.FatalfinTestMain, so tests cannot self-skip or be isolated as integration-only.
Suspected Root Cause
Docker-backed registry setup is performed at package startup without any Docker availability probe, integration gate, or graceful skip path.
Proposed Direction
Probe Docker availability before starting the registry and skip the package tests cleanly when Docker is absent, or gate these tests behind an explicit integration path while keeping them runnable in CI.
Acceptance Criteria
- Plain
go testno longer hard-fails solely because Docker is unavailable. - Docker-backed OCI tests remain runnable in CI or with an explicit integration target.
- Test output clearly distinguishes skipped integration tests from real failures.
What you expected to happen:
Docker-dependent pkg/oci tests should either run only behind an explicit integration gate or skip cleanly when Docker is unavailable.
How to reproduce it:
Steps to Reproduce
- Ensure Docker is not running or
/var/run/docker.sockis unavailable. - Run
go test ./pkg/ociorgo test ./pkg/... ./cmd/.... - Observe the failure from
pkg/ociduringTestMainbefore individual tests run.
Environment:
pipedversion: repository checkout from upstreammasterfetched on July 11, 2026control-planeversion: Not applicable- Others: reproduced in a local environment without Docker daemon access
Expected Behaviour
Docker-unavailable environments should see the OCI test package skipped cleanly rather than aborting the whole test run.
Actual Behaviour
The package exits from TestMain with a Docker socket connection failure.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in pkg/oci/main_test.go and inspect TestMain, especially the dockertest.NewPool and pool.RunWithOptions calls that fail without Docker. Run go test ./pkg/oci in an environment without Docker, then verify that Docker-backed tests are skipped clearly while remaining runnable when Docker is available or through an explicit integration path.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, go
- Domain
- testing-qa
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 74/100