testenv

package
v0.22.0 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2026 License: Apache-2.0 Imports: 49 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var InlineBuildOutput bool

Functions

func WithHostNetworking

func WithHostNetworking(trc *TestRunnerConfig)

func WithProxyNetwork added in v0.22.0

func WithProxyNetwork(trc *TestRunnerConfig)

Types

type BuildxEnv

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

func New

func New() *BuildxEnv

func (*BuildxEnv) Buildkit

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

func (*BuildxEnv) Close added in v0.21.0

func (b *BuildxEnv) Close() error

Close closes the underlying buildkit client connection, which triggers cleanup of the dial-stdio process.

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) 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 WithOCIStore added in v0.22.0

func WithOCIStore(id string, store content.Store) TestRunnerOpt

WithOCIStore registers an OCI layout content store with the build session under the provided id. The store can then be referenced from a build context using an "oci-layout:<id>@<digest>" value, allowing platform-specific manifest selection from a multi-platform index without needing a registry.

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

func WithSourcePolicy added in v0.22.0

func WithSourcePolicy(pol *spb.Policy) TestRunnerOpt

WithSourcePolicy merges the given source policy rules into the build's source policy. Rules are appended to any policy already configured (e.g. via the EXPERIMENTAL_BUILDKIT_SOURCE_POLICY environment variable).

Jump to

Keyboard shortcuts

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