pipe-cd / pipe-cd/pipecd

pkg/oci tests abort when Docker is unavailable

Open
#7,008 0 comments 0 reactions 0 assignees View on GitHub

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/oci
  • pkg/oci/main_test.go

Technical Evidence

  • pkg/oci/main_test.go unconditionally creates a Docker-backed registry in TestMain via dockertest.NewPool("") and pool.RunWithOptions(...).
  • Running go test ./pkg/oci on July 11, 2026 in an environment without /var/run/docker.sock fails 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.Fatalf in TestMain, 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 test no 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

  1. Ensure Docker is not running or /var/run/docker.sock is unavailable.
  2. Run go test ./pkg/oci or go test ./pkg/... ./cmd/....
  3. Observe the failure from pkg/oci during TestMain before individual tests run.

Environment:

  • piped version: repository checkout from upstream master fetched on July 11, 2026
  • control-plane version: 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.