Documentation ¶
Index ¶
- Variables
- func BuildGossamer() (err error)
- func GenerateGenesisAuths(t *testing.T, numAuths int) (genesisPath string)
- func NewTestWriter(t *testing.T) (writer io.Writer)
- type Framework
- func (fw *Framework) CallRPC(ctx context.Context, idx int, method, params string) (respJSON interface{}, err error)
- func (fw *Framework) CheckEqual(c1, c2 int, field string) bool
- func (fw *Framework) GetRecord(callIdx int) interface{}
- func (fw *Framework) PrintDB()
- func (fw *Framework) StartNodes(ctx context.Context, t *testing.T) (runtimeErrors []<-chan error, startErr error)
- type TestWriter
Constants ¶
This section is empty.
Variables ¶
var ( // MODE is the value for the environnent variable MODE. MODE = os.Getenv("MODE") // PORT is the value for the environnent variable PORT. PORT = os.Getenv("PORT") // LOGLEVEL is the value for the environnent variable LOGLEVEL. LOGLEVEL = os.Getenv("LOG") )
var Logger = log.NewFromGlobal(log.AddContext("pkg", "test/utils"))
Logger is the utils package local logger.
Functions ¶
func BuildGossamer ¶ added in v0.7.0
func BuildGossamer() (err error)
BuildGossamer finds the project root path and builds the Gossamer binary to ./bin/gossamer at the project root path.
func GenerateGenesisAuths ¶ added in v0.7.0
GenerateGenesisAuths generates a genesis file with numAuths authorities and returns the file path to the genesis file. The genesis file is automatically removed when the test ends.
Types ¶
type Framework ¶ added in v0.2.0
type Framework struct {
// contains filtered or unexported fields
}
Framework struct to hold references to framework data
func InitFramework ¶ added in v0.2.0
func InitFramework(ctx context.Context, t *testing.T, qtyNodes int, tomlConfig cfg.Config) (*Framework, error)
InitFramework creates given quantity of nodes
func NewFramework ¶ added in v0.7.0
func NewFramework() (framework *Framework)
NewFramework creates a new framework.
func (*Framework) CallRPC ¶ added in v0.2.0
func (fw *Framework) CallRPC(ctx context.Context, idx int, method, params string) ( respJSON interface{}, err error)
CallRPC call RPC method with given params for node at idx
func (*Framework) CheckEqual ¶ added in v0.2.0
CheckEqual returns true if the field values are equal
func (*Framework) GetRecord ¶ added in v0.2.0
GetRecord return value of record for node and call index
type TestWriter ¶ added in v0.7.0
type TestWriter struct {
// contains filtered or unexported fields
}
TestWriter is a writer implementing `io.Writer` using the Go test logger `t.Log()`.