testsetups

package
v1.2.3 Latest Latest
Warning

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

Go to latest
Published: May 23, 2022 License: MIT Imports: 20 Imported by: 1

Documentation

Overview

Package testsetups compresses common test setups and more complicated setups like performance and chaos tests.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Index added in v1.1.22

Index to see barbones running statistics

func ShutDown added in v1.1.22

func ShutDown(w http.ResponseWriter, r *http.Request, _ httprouter.Params)

ShutDown attempts to gracefully shut down the running test

func ShutDownConfirm added in v1.1.22

func ShutDownConfirm(w http.ResponseWriter, r *http.Request, ps httprouter.Params)

ShutDownConfirm requires the user to enter a randomly generated code to shut down the test

func StartRemoteControlServer added in v1.1.22

func StartRemoteControlServer(name string, stopChan chan struct{})

StartRemoteControlServer starts a server to control soak test shut downs. Shutdown signal is sent to the stopChan

Types

type ChainlinkProfileTest added in v1.1.22

type ChainlinkProfileTest struct {
	Inputs       ChainlinkProfileTestInputs
	TestReporter testreporters.ChainlinkProfileTestReporter
	// contains filtered or unexported fields
}

ChainlinkProfileTest runs a piece of code on Chainlink nodes with PPROF enabled, then downloads the PPROF results

func NewChainlinkProfileTest added in v1.1.22

func NewChainlinkProfileTest(inputs ChainlinkProfileTestInputs) *ChainlinkProfileTest

NewChainlinkProfileTest prepares a new keeper Chainlink profiling test to be run

func (*ChainlinkProfileTest) Run added in v1.1.22

func (c *ChainlinkProfileTest) Run()

Run runs the profiling test

func (*ChainlinkProfileTest) Setup added in v1.1.22

Setup prepares contracts for the test

func (*ChainlinkProfileTest) TearDownVals added in v1.1.22

Networks returns the networks that the test is running on

type ChainlinkProfileTestInputs added in v1.1.22

type ChainlinkProfileTestInputs struct {
	ProfileFunction func(client.Chainlink)
	ProfileDuration time.Duration
	ChainlinkNodes  []client.Chainlink
}

ChainlinkProfileTestInputs are the inputs necessary to run a profiling tests

type KeeperBlockTimeTest

type KeeperBlockTimeTest struct {
	Inputs       KeeperBlockTimeTestInputs
	TestReporter testreporters.KeeperBlockTimeTestReporter
	// contains filtered or unexported fields
}

KeeperBlockTimeTest builds a test to check that chainlink nodes are able to upkeep a specified amount of Upkeep contracts within a certain block time

func NewKeeperBlockTimeTest

func NewKeeperBlockTimeTest(inputs KeeperBlockTimeTestInputs) *KeeperBlockTimeTest

NewKeeperBlockTimeTest prepares a new keeper block time test to be run

func (*KeeperBlockTimeTest) Run

func (k *KeeperBlockTimeTest) Run()

Run runs the keeper block time test

func (*KeeperBlockTimeTest) Setup

Setup prepares contracts for the test

func (*KeeperBlockTimeTest) TearDownVals

Networks returns the networks that the test is running on

type KeeperBlockTimeTestInputs

type KeeperBlockTimeTestInputs struct {
	NumberOfContracts      int                               // Number of upkeep contracts
	KeeperRegistrySettings *contracts.KeeperRegistrySettings // Settings of each keeper contract
	Timeout                time.Duration                     // Timeout for the test
	BlockRange             int64                             // How many blocks to run the test for
	BlockInterval          int64                             // Interval of blocks that upkeeps are expected to be performed
	CheckGasToBurn         int64                             // How much gas should be burned on checkUpkeep() calls
	PerformGasToBurn       int64                             // How much gas should be burned on performUpkeep() calls
	ChainlinkNodeFunding   *big.Float                        // Amount of ETH to fund each chainlink node with
}

KeeperBlockTimeTestInputs are all the required inputs for a Keeper Block Time Test

type OCRSoakTest

type OCRSoakTest struct {
	Inputs *OCRSoakTestInputs

	TestReporter testreporters.OCRSoakTestReporter
	// contains filtered or unexported fields
}

OCRSoakTest defines a typical OCR soak test

func NewOCRSoakTest

func NewOCRSoakTest(inputs *OCRSoakTestInputs) *OCRSoakTest

NewOCRSoakTest creates a new OCR soak test to setup and run

func (*OCRSoakTest) Run

func (t *OCRSoakTest) Run()

Run starts the OCR soak test

func (*OCRSoakTest) Setup

func (t *OCRSoakTest) Setup(env *environment.Environment)

Setup sets up the test environment, deploying contracts and funding chainlink nodes

func (*OCRSoakTest) TearDownVals

Networks returns the networks that the test is running on

type OCRSoakTestInputs

type OCRSoakTestInputs struct {
	TestDuration         time.Duration // How long to run the test for (assuming things pass)
	NumberOfContracts    int           // Number of OCR contracts to launch
	ChainlinkNodeFunding *big.Float    // Amount of ETH to fund each chainlink node with
	RoundTimeout         time.Duration // How long to wait for a round to update before failing the test
	ExpectedRoundTime    time.Duration // How long each round is expected to take
	TimeBetweenRounds    time.Duration // How long to wait after a completed round to start a new one, set 0 for instant
	StartingAdapterValue int
}

OCRSoakTestInputs define required inputs to run an OCR soak test

Jump to

Keyboard shortcuts

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