e2e

package
v0.0.0-...-953790c Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2018 License: MPL-2.0 Imports: 15 Imported by: 0

README

e2e

This package contains all e2e tests divided into subpackages which represents (or should represent) business domains like transactions, chat etc.

These tests are run against public testnets: Ropsten and Rinkeby.

e2e package contains a few utilities which are described in a godoc.

Flags
1. -network

The -network flag is used to provide either a network id or network name which specifies the ethereum network to use for running all test. It by default uses the StatusChain network.

Usage

To use the ropsten network for testing using network name:

go test -v ./e2e/... -network=ropsten

To use the rinkeby network with chain id 4 for testing:

go test -v ./e2e/... -network=4

Run

make test-e2e

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FirstBlockHash

func FirstBlockHash(nodeManager common.NodeManager) (string, error)

FirstBlockHash validates Attach operation for the NodeManager.

func MakeTestNodeConfig

func MakeTestNodeConfig(networkID int) (*params.NodeConfig, error)

MakeTestNodeConfig defines a function to return a giving params.NodeConfig where specific network addresses are assigned based on provieded network id.

Types

type BackendTestSuite

type BackendTestSuite struct {
	suite.Suite
	Backend *api.StatusBackend
}

BackendTestSuite is a test suite with api.StatusBackend initialized and a few utility methods to start and stop node or get various services.

func (*BackendTestSuite) LightEthereumService

func (s *BackendTestSuite) LightEthereumService() *les.LightEthereum

LightEthereumService returns a reference to the LES service.

func (*BackendTestSuite) RestartTestNode

func (s *BackendTestSuite) RestartTestNode()

RestartTestNode restarts a currently running node.

func (*BackendTestSuite) SetupTest

func (s *BackendTestSuite) SetupTest()

SetupTest initializes Backend.

func (*BackendTestSuite) StartTestBackend

func (s *BackendTestSuite) StartTestBackend(opts ...TestNodeOption)

StartTestBackend imports some keys and starts a node.

func (*BackendTestSuite) StopTestBackend

func (s *BackendTestSuite) StopTestBackend()

StopTestBackend stops the node.

func (*BackendTestSuite) TearDownTest

func (s *BackendTestSuite) TearDownTest()

TearDownTest cleans up the packages state.

func (*BackendTestSuite) TxQueueManager

func (s *BackendTestSuite) TxQueueManager() common.TxQueueManager

TxQueueManager returns a reference to the TxQueueManager.

func (*BackendTestSuite) WhisperService

func (s *BackendTestSuite) WhisperService() *whisper.Whisper

WhisperService returns a reference to the Whisper service.

type NodeManagerTestSuite

type NodeManagerTestSuite struct {
	suite.Suite
	NodeManager common.NodeManager
}

NodeManagerTestSuite defines a test suit with NodeManager.

func (*NodeManagerTestSuite) StartTestNode

func (s *NodeManagerTestSuite) StartTestNode(opts ...TestNodeOption)

StartTestNode initiazes a NodeManager instances with configuration retrieved from the test config.

func (*NodeManagerTestSuite) StopTestNode

func (s *NodeManagerTestSuite) StopTestNode()

StopTestNode attempts to stop initialized NodeManager.

type TestNodeOption

type TestNodeOption func(config *params.NodeConfig)

TestNodeOption is a callback passed to StartTestNode which alters its config.

func WithUpstream

func WithUpstream(url string) TestNodeOption

WithUpstream returns TestNodeOption which enabled UpstreamConfig.

Jump to

Keyboard shortcuts

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