testcontext

package
v1.5.7 Latest Latest
Warning

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

Go to latest
Published: May 30, 2024 License: MIT Imports: 27 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ParamLayersPerEpoch = "layers-per-epoch"
	ParamLayerDuration  = "layer-duration"
)

Variables

View Source
var (
	LayerDuration = parameters.Duration(
		ParamLayerDuration, "layer duration in seconds", 5*time.Second,
	)
	LayersPerEpoch = parameters.Int(
		ParamLayersPerEpoch, "number of layers in an epoch", 4,
	)
)

Functions

This section is empty.

Types

type Context

type Context struct {
	context.Context
	Client            *kubernetes.Clientset
	Parameters        *parameters.Parameters
	BootstrapDuration time.Duration
	ClusterSize       int
	BootnodeSize      int
	RemoteSize        int
	PoetSize          int
	BootstrapperSize  int
	Generic           client.Client
	TestID            string
	Keep              bool
	Namespace         string
	Image             string
	BootstrapperImage string
	PoetImage         string
	PostServiceImage  string
	PostInitImage     string
	Storage           struct {
		Size  string
		Class string
	}
	NodeSelector map[string]string
	Log          *zap.SugaredLogger
}

Context must be created for every test that needs isolated cluster.

func New

func New(t *testing.T, opts ...Opt) *Context

New creates context for the test.

type Opt

type Opt func(*cfg)

Opt is for configuring Context.

func Labels

func Labels(labels ...string) Opt

Labels sets list of labels for the test.

func SkipClusterLimits

func SkipClusterLimits() Opt

SkipClusterLimits will not block if there are no available tokens.

Jump to

Keyboard shortcuts

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