Documentation ¶
Overview ¶
Package integration provides poet-specific RPC testing harness crafting and executing integration tests by driving a poet server instance via the RPC interface.
This package was designed specifically to act as an RPC testing harness. However, the constructs presented are general enough to be adapted to any project wishing to programmatically drive a poet server instance.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Harness ¶
type Harness struct { api.PoetServiceClient // contains filtered or unexported fields }
Harness fully encapsulates an active poet server process to provide a unified platform to programmatically drive a poet server instance, whether for creating rpc driven integration tests, or for any other usage.
func NewHarness ¶
func NewHarness(ctx context.Context, cfg *ServerConfig) (*Harness, error)
NewHarness creates and initializes a new instance of Harness.
func (*Harness) ProcessErrors ¶
ProcessErrors returns a channel used for reporting any fatal process errors.
func (*Harness) RESTListen ¶
RESTListen returns the configured interface/port/socket for REST connections.
func (*Harness) StderrPipe ¶ added in v0.2.0
StderrPipe returns an stderr reader for the server process.
func (*Harness) StdoutPipe ¶ added in v0.2.0
StdoutPipe returns an stdout reader for the server process.
type ServerConfig ¶
type ServerConfig struct { DataDir string Genesis time.Time EpochDuration time.Duration PhaseShift time.Duration CycleGap time.Duration DebugLog bool Reset bool RESTListen string RpcListen string GatewayAddresses []string GtwConnTimeout time.Duration // contains filtered or unexported fields }
ServerConfig contains all the args and data required to launch a poet server instance and connect to it via rpc client.
func DefaultConfig ¶
func DefaultConfig() (*ServerConfig, error)
DefaultConfig returns a newConfig with all default values.