runner

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2022 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Start

func Start(logger *zap.Logger, scenario Scenario, bootstrapper Bootstrapper)

Start starts the runner

Types

type Bootstrapper

type Bootstrapper func(ctx context.Context, logger *zap.Logger, scenario Scenario) (*ScenarioContext, error)

Bootstrapper bootstraps the given scenario

type Router

type Router struct {
	Logger      *zap.Logger
	Controllers controller.Controllers
}

Router is an helper router to read messages

func (*Router) Route

func (r *Router) Route(message spectypes.SSVMessage)

Route processes message and routes it to the right controller

type Scenario

type Scenario interface {

	// Name is the name of the scenario
	Name() string
	// PreExecution is invoked prior to the scenario, used for setup
	PreExecution(ctx *ScenarioContext) error
	// Execute is the actual test scenario to run
	Execute(ctx *ScenarioContext) error
	// PostExecution is invoked after execution, used for cleanup etc.
	PostExecution(ctx *ScenarioContext) error
	// contains filtered or unexported methods
}

Scenario represents a testplan for a specific scenario

type ScenarioContext

type ScenarioContext struct {
	Ctx         context.Context
	LocalNet    *p2pv1.LocalNet
	Stores      []qbftstorageprotocol.QBFTStore
	KeyManagers []spectypes.KeyManager
	DBs         []basedb.IDb
}

ScenarioContext is the context object that is passed in execution

type ScenarioFactory

type ScenarioFactory func(name string) Scenario

ScenarioFactory creates Scenario instances

Jump to

Keyboard shortcuts

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