mirror of
https://github.com/hanzo-git/runner.git
synced 2026-10-30 19:33:27 +00:00
Native runner: module github.com/hanzo-git/runner, wire proto github.com/hanzo-git/actions-proto-go, command git-runner, GIT_* env, git expr context, git_* task-context keys, ghcr.io/hanzoai/runner-ubuntu job images. Derived work — upstream attribution + MIT terms in NOTICE/LICENSE. Co-authored-by: Hanzo Dev <[email protected]>
28 lines
764 B
Go
28 lines
764 B
Go
// Copyright 2026 The Git Authors. All rights reserved.
|
|
// SPDX-License-Identifier: MIT
|
|
|
|
package container
|
|
|
|
import (
|
|
"context"
|
|
"testing"
|
|
|
|
mobyclient "github.com/moby/moby/client"
|
|
)
|
|
|
|
// requireDocker skips the test unless a reachable docker daemon is available.
|
|
// GetDockerClient succeeds even without a running daemon (its ping is best-effort),
|
|
// so the daemon has to be pinged explicitly here to decide whether to skip.
|
|
func requireDocker(t *testing.T) {
|
|
t.Helper()
|
|
ctx := context.Background()
|
|
cli, err := GetDockerClient(ctx)
|
|
if err != nil {
|
|
t.Skipf("skipping: docker client unavailable: %v", err)
|
|
}
|
|
defer cli.Close()
|
|
if _, err := cli.Ping(ctx, mobyclient.PingOptions{}); err != nil {
|
|
t.Skipf("skipping: docker daemon unreachable: %v", err)
|
|
}
|
|
}
|