testcontext

package
v1.7.0-alpha.0-nomain Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2024 License: MIT Imports: 29 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
	CertifierImage    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.

func (*Context) CheckFail added in v1.7.0

func (c *Context) CheckFail() error

type Opt

type Opt func(*cfg)

Opt is for configuring Context.

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