testenv

package
v0.19.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 8, 2025 License: Apache-2.0 Imports: 39 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var InlineBuildOutput bool

Functions

func WithHostNetworking

func WithHostNetworking(trc *TestRunnerConfig)

Types

type BuildxEnv

type BuildxEnv struct {
	// contains filtered or unexported fields
}

func New

func New() *BuildxEnv

func NewWithNetHostBuildxInstance

func NewWithNetHostBuildxInstance(ctx context.Context, t *testing.T) *BuildxEnv

`NewWithNetHostBuildxInstance` creates a buildx instance with host networking enabled.

func (*BuildxEnv) Buildkit

func (b *BuildxEnv) Buildkit(ctx context.Context) (*client.Client, error)

func (*BuildxEnv) Load

func (b *BuildxEnv) Load(ctx context.Context, id string, f gwclient.BuildFunc) error

Load loads the output of the specified gwclient.BuildFunc into the buildkit instance.

func (*BuildxEnv) RunTest

func (b *BuildxEnv) RunTest(ctx context.Context, t *testing.T, f TestFunc, opts ...TestRunnerOpt)

func (*BuildxEnv) RunTestOptsFirst

func (b *BuildxEnv) RunTestOptsFirst(ctx context.Context, t *testing.T, opts []TestRunnerOpt, f TestFunc)

This function just puts the opts before the function argument, which makes it harder to miss what's happening with the opts for those unfamiliar with the pattern.

func (*BuildxEnv) WithBuilder

func (b *BuildxEnv) WithBuilder(builder string) *BuildxEnv

type FrontendSpec

type FrontendSpec struct {
	ID    string
	Build gwclient.BuildFunc
}

type SolveOpt

type SolveOpt = client.SolveOpt

type SolveStatus

type SolveStatus = client.SolveStatus

SolveStatus is convenience wrapper for client.SolveStatus to help disambiguate imports of the client package.

type TestFunc

type TestFunc func(context.Context, gwclient.Client)

type TestRunnerConfig

type TestRunnerConfig struct {
	// SolveStatusFn replaces the builtin status logger with a custom implementation.
	// This is useful particularly if you need to inspect the solve statuses.
	SolveStatusFn func(*client.SolveStatus)
	SolveOptFns   []func(*client.SolveOpt)
	// SocketProxies is the list of sockets that need to be forwarded into the build.
	SocketProxies []socketprovider.ProxyConfig
}

type TestRunnerOpt

type TestRunnerOpt func(*TestRunnerConfig)

func WithSSHSocket

func WithSSHSocket(id, addr string) TestRunnerOpt

func WithSecrets

func WithSecrets(k, v string) TestRunnerOpt

func WithSocketProxies

func WithSocketProxies(proxies ...socketprovider.ProxyConfig) TestRunnerOpt

func WithSolveStatusFn

func WithSolveStatusFn(f func(*SolveStatus)) TestRunnerOpt

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL