testenv

package
v0.16.0 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2025 License: MIT Imports: 34 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithHostNetworking added in v0.16.0

func WithHostNetworking(trc *TestRunnerConfig)

Types

type BuildxEnv

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

func New

func New() *BuildxEnv

func NewWithNetHostBuildxInstance added in v0.16.0

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 added in v0.16.0

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 added in v0.16.0

type SolveOpt = client.SolveOpt

type SolveStatus added in v0.7.0

type SolveStatus = client.SolveStatus

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

type TestFunc added in v0.6.1

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

type TestRunnerConfig added in v0.7.0

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 added in v0.7.0

type TestRunnerOpt func(*TestRunnerConfig)

func WithSSHSocket added in v0.16.0

func WithSSHSocket(id, addr string) TestRunnerOpt

func WithSecrets added in v0.16.0

func WithSecrets(k, v string) TestRunnerOpt

func WithSocketProxies added in v0.16.0

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

func WithSolveStatusFn added in v0.7.0

func WithSolveStatusFn(f func(*SolveStatus)) TestRunnerOpt

Jump to

Keyboard shortcuts

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