Documentation
¶
Index ¶
- Constants
- Variables
- func CheckBootstrapIsPossible(tc tests.TestContext, network *tmpnet.Network) error
- func DescribeCChain(text string, args ...interface{}) bool
- func DescribePChain(text string, args ...interface{}) bool
- func DescribeXChain(text string, args ...interface{}) bool
- func DescribeXChainSerial(text string, args ...interface{}) bool
- func ExecuteAPITest(apiTest APITestFunction)
- func NewTestContext() tests.TestContext
- func NewWallet(tc tests.TestContext, keychain *secp256k1fx.Keychain, uri tmpnet.NodeURI) *primary.Wallet
- type APITestFunction
- type FlagVars
- type GinkgoTestContext
- func (*GinkgoTestContext) By(text string, callback ...func())
- func (*GinkgoTestContext) Cleanup()
- func (tc *GinkgoTestContext) ContextWithTimeout(duration time.Duration) context.Context
- func (tc *GinkgoTestContext) DefaultContext() context.Context
- func (*GinkgoTestContext) DeferCleanup(cleanup func())
- func (*GinkgoTestContext) Errorf(format string, args ...interface{})
- func (*GinkgoTestContext) Eventually(condition func() bool, waitFor time.Duration, tick time.Duration, msg string)
- func (*GinkgoTestContext) FailNow()
- func (*GinkgoTestContext) GetDefaultContextParent() context.Context
- func (tc *GinkgoTestContext) Log() logging.Logger
- func (tc *GinkgoTestContext) WithDefaultContext() common.Option
- type TestEnvironment
Constants ¶
const ( // Label for filtering a test that is not primarily a C-Chain test // but nonentheless uses the C-Chain. Intended to support // execution of all C-Chain tests by the coreth repo in an e2e job. UsesCChainLabel = "uses-c" )
Variables ¶
var EmitMetricsLink bool
Whether a spec-scoped metrics link should be emitted after the current spec finishes executing.
Functions ¶
func CheckBootstrapIsPossible ¶
func CheckBootstrapIsPossible(tc tests.TestContext, network *tmpnet.Network) error
CheckBootstrapIsPossible verifies that bootstrap is possible for the network
func DescribeCChain ¶
DescribeCChain annotates the tests for C-Chain.
func DescribePChain ¶
DescribePChain annotates the tests for P-Chain.
func DescribeXChain ¶
DescribeXChain annotates the tests for X-Chain.
func DescribeXChainSerial ¶
DescribeXChainSerial annotates serial tests for X-Chain.
func ExecuteAPITest ¶ added in v1.11.14
func ExecuteAPITest(apiTest APITestFunction)
ExecuteAPITest executes a test whose primary dependency is being able to access the API of one or more luxd nodes.
func NewTestContext ¶
func NewTestContext() tests.TestContext
NewTestContext creates a new test context
func NewWallet ¶
func NewWallet(tc tests.TestContext, keychain *secp256k1fx.Keychain, uri tmpnet.NodeURI) *primary.Wallet
NewWallet creates a new wallet for testing
Types ¶
type APITestFunction ¶ added in v1.11.14
TODO(marun) What else does a test need? e.g. node URIs?
type FlagVars ¶
type FlagVars struct {
// contains filtered or unexported fields
}
func RegisterFlags ¶
func RegisterFlags() *FlagVars
func (*FlagVars) LuxNodeExecPath ¶ added in v1.1.11
func (*FlagVars) NetworkDir ¶
func (*FlagVars) NetworkShutdownDelay ¶
func (*FlagVars) ReuseNetwork ¶ added in v1.1.11
func (*FlagVars) StopNetwork ¶ added in v1.1.11
type GinkgoTestContext ¶
type GinkgoTestContext struct {
// contains filtered or unexported fields
}
func NewEventHandlerTestContext ¶
func NewEventHandlerTestContext() *GinkgoTestContext
NewEventHandlerTestContext provides a logger with full output to account for the limited context otherwise provided in an event handler e.g. SynchronizedBeforeSuite.
func NewTestContext ¶
func NewTestContext() *GinkgoTestContext
NewTestContext provides a logger with limited output to account for the context already provided by ginkgo for test logging.
func (*GinkgoTestContext) By ¶
func (*GinkgoTestContext) By(text string, callback ...func())
func (*GinkgoTestContext) Cleanup ¶
func (*GinkgoTestContext) Cleanup()
func (*GinkgoTestContext) ContextWithTimeout ¶
func (tc *GinkgoTestContext) ContextWithTimeout(duration time.Duration) context.Context
Helper simplifying use of a timed context by canceling the context on ginkgo teardown.
func (*GinkgoTestContext) DefaultContext ¶
func (tc *GinkgoTestContext) DefaultContext() context.Context
Helper simplifying use of a timed context configured with the default timeout.
func (*GinkgoTestContext) DeferCleanup ¶
func (*GinkgoTestContext) DeferCleanup(cleanup func())
func (*GinkgoTestContext) Errorf ¶
func (*GinkgoTestContext) Errorf(format string, args ...interface{})
func (*GinkgoTestContext) Eventually ¶
func (*GinkgoTestContext) Eventually(condition func() bool, waitFor time.Duration, tick time.Duration, msg string)
Re-implementation of testify/require.Eventually that is compatible with ginkgo. testify's version calls the condition function with a goroutine and ginkgo assertions don't work properly in goroutines.
func (*GinkgoTestContext) FailNow ¶
func (*GinkgoTestContext) FailNow()
func (*GinkgoTestContext) GetDefaultContextParent ¶ added in v1.11.14
func (*GinkgoTestContext) GetDefaultContextParent() context.Context
func (*GinkgoTestContext) Log ¶
func (tc *GinkgoTestContext) Log() logging.Logger
func (*GinkgoTestContext) WithDefaultContext ¶
func (tc *GinkgoTestContext) WithDefaultContext() common.Option
Helper simplifying use via an option of a timed context configured with the default timeout.
type TestEnvironment ¶
type TestEnvironment struct {
Network *tmpnet.Network
Nodes []*tmpnet.Node
Keychain *secp256k1fx.Keychain
}
TestEnvironment represents the test environment
var Env *TestEnvironment
Env is the global test environment
func GetEnv ¶
func GetEnv(tc tests.TestContext) *TestEnvironment
GetEnv returns the test environment
func (*TestEnvironment) GetNetwork ¶
func (e *TestEnvironment) GetNetwork() *tmpnet.Network
GetNetwork returns the test network
func (*TestEnvironment) GetRandomNodeURI ¶
func (e *TestEnvironment) GetRandomNodeURI() tmpnet.NodeURI
GetRandomNodeURI returns a random node URI from the network
func (*TestEnvironment) NewKeychain ¶
func (e *TestEnvironment) NewKeychain() *secp256k1fx.Keychain
NewKeychain creates a new keychain for testing