integration

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2023 License: Apache-2.0 Imports: 44 Imported by: 7

Documentation

Index

Constants

View Source
const (
	FeatureCacheExport          = "cache_export"
	FeatureCacheImport          = "cache_import"
	FeatureCacheBackendAzblob   = "cache_backend_azblob"
	FeatureCacheBackendGha      = "cache_backend_gha"
	FeatureCacheBackendInline   = "cache_backend_inline"
	FeatureCacheBackendLocal    = "cache_backend_local"
	FeatureCacheBackendRegistry = "cache_backend_registry"
	FeatureCacheBackendS3       = "cache_backend_s3"
	FeatureDirectPush           = "direct_push"
	FeatureFrontendOutline      = "frontend_outline"
	FeatureFrontendTargets      = "frontend_targets"
	FeatureImageExporter        = "image_exporter"
	FeatureInfo                 = "info"
	FeatureMergeDiff            = "merge_diff"
	FeatureMultiCacheExport     = "multi_cache_export"
	FeatureMultiPlatform        = "multi_platform"
	FeatureOCIExporter          = "oci_exporter"
	FeatureOCILayout            = "oci_layout"
	FeatureProvenance           = "provenance"
	FeatureSBOM                 = "sbom"
	FeatureSecurityMode         = "security_mode"
	FeatureSourceDateEpoch      = "source_date_epoch"
	FeatureCNINetwork           = "cni_network"
)

Variables

View Source
var ErrRequirements = errors.Errorf("missing requirements")

Functions

func CheckContainerdVersion added in v0.12.0

func CheckContainerdVersion(t *testing.T, cdAddress, constraint string)

func CheckFeatureCompat added in v0.11.0

func CheckFeatureCompat(t *testing.T, sb Sandbox, reason ...string)

func InitContainerdWorker added in v0.5.0

func InitContainerdWorker()

func InitDockerdWorker added in v0.8.0

func InitDockerdWorker()

InitDockerdWorker registers a dockerd worker with the global registry.

func InitOCIWorker added in v0.5.0

func InitOCIWorker()

func IsTestDockerd added in v0.10.1

func IsTestDockerd() bool

func IsTestDockerdMoby added in v0.11.0

func IsTestDockerdMoby(sb Sandbox) bool

func NewAzuriteServer added in v0.12.0

func NewAzuriteServer(t *testing.T, sb Sandbox, opts AzuriteOpts) (address string, cl func() error, err error)

func NewMinioServer added in v0.12.0

func NewMinioServer(t *testing.T, sb Sandbox, opts MinioOpts) (address string, bucket string, cl func() error, err error)

func NewRegistry added in v0.5.0

func NewRegistry(dir string) (url string, cl func() error, err error)

func OfficialImages

func OfficialImages(names ...string) map[string]string

func Register added in v0.5.0

func Register(w Worker)

func Run

func Run(t *testing.T, testCases []Test, opt ...TestOpt)

func Tmpdir added in v0.11.0

func Tmpdir(t *testing.T, appliers ...fstest.Applier) (string, error)

Types

type AzuriteOpts added in v0.12.0

type AzuriteOpts struct {
	AccountName string
	AccountKey  string
}

type Backend added in v0.7.0

type Backend interface {
	Address() string
	DockerAddress() string
	ContainerdAddress() string
	Rootless() bool
	Snapshotter() string
}

Backend is the minimal interface that describes a testing backend.

type BackendConfig added in v0.7.0

type BackendConfig struct {
	Logs       map[string]*bytes.Buffer
	ConfigFile string
}

BackendConfig is used to configure backends created by a worker.

type ConfigUpdater added in v0.5.0

type ConfigUpdater interface {
	UpdateConfigFile(string) string
}

type Containerd added in v0.12.0

type Containerd struct {
	ID          string
	Containerd  string
	Snapshotter string
	UID         int
	GID         int
	ExtraEnv    []string // e.g. "PATH=/opt/containerd-1.4/bin:/usr/bin:..."
}

func (*Containerd) Close added in v0.12.0

func (c *Containerd) Close() error

func (*Containerd) Name added in v0.12.0

func (c *Containerd) Name() string

func (*Containerd) New added in v0.12.0

func (c *Containerd) New(ctx context.Context, cfg *BackendConfig) (b Backend, cl func() error, err error)

func (*Containerd) Rootless added in v0.12.0

func (c *Containerd) Rootless() bool

type MinioOpts added in v0.12.0

type MinioOpts struct {
	Region          string
	AccessKeyID     string
	SecretAccessKey string
}

type Moby added in v0.12.0

type Moby struct {
	ID         string
	IsRootless bool

	ContainerdSnapshotter bool

	Unsupported []string
}

func (Moby) Close added in v0.12.0

func (c Moby) Close() error

func (Moby) Name added in v0.12.0

func (c Moby) Name() string

func (Moby) New added in v0.12.0

func (c Moby) New(ctx context.Context, cfg *BackendConfig) (b Backend, cl func() error, err error)

func (Moby) Rootless added in v0.12.0

func (c Moby) Rootless() bool

type OCI added in v0.12.0

type OCI struct {
	ID          string
	UID         int
	GID         int
	Snapshotter string
}

func (*OCI) Close added in v0.12.0

func (s *OCI) Close() error

func (*OCI) Name added in v0.12.0

func (s *OCI) Name() string

func (*OCI) New added in v0.12.0

func (s *OCI) New(ctx context.Context, cfg *BackendConfig) (Backend, func() error, error)

func (*OCI) Rootless added in v0.12.0

func (s *OCI) Rootless() bool

type Sandbox

type Sandbox interface {
	Backend

	Context() context.Context
	Cmd(...string) *exec.Cmd
	Logs() map[string]*bytes.Buffer
	PrintLogs(*testing.T)
	ClearLogs()
	NewRegistry() (string, error)
	Value(string) interface{} // chosen matrix value
	Name() string
}

type Test

type Test interface {
	Name() string
	Run(t *testing.T, sb Sandbox)
}

func TestFuncs added in v0.10.0

func TestFuncs(funcs ...func(t *testing.T, sb Sandbox)) []Test

type TestOpt

type TestOpt func(*testConf)

TestOpt is an option that can be used to configure a set of integration tests.

func WithMatrix

func WithMatrix(key string, m map[string]interface{}) TestOpt

func WithMirroredImages

func WithMirroredImages(m map[string]string) TestOpt

type Worker

type Worker interface {
	New(context.Context, *BackendConfig) (Backend, func() error, error)
	Close() error
	Name() string
	Rootless() bool
}

func List

func List() []Worker

Jump to

Keyboard shortcuts

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