fullenv

package
v0.0.0-...-05a97e5 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2020 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ExpectedError

type ExpectedError struct {
	MatchMessage MatchMessage
	Name         string
}

ExpectedError is the definition of an expected error

func ExpectsContains

func ExpectsContains(value string) ExpectedError

ExpectsContains returns a ExpectedError matching a partial message

func ExpectsEqual

func ExpectsEqual(value string) ExpectedError

ExpectsEqual returns a ExpectedError matching a message exactly

type Fullenv

type Fullenv struct {
	// contains filtered or unexported fields
}

Fullenv uses the xbus-fullenv binary to coordinate tests

func NewFullenv

func NewFullenv(configPath string, logger xbus.Logger) *Fullenv

NewFullenv instanciate a Fullenv

func NewFullenvForTest

func NewFullenvForTest(t testing.TB, name string, configPath string) *Fullenv

NewFullenvForTest returns a fullenv associated to the giveng test

func (*Fullenv) ClientConfig

func (fe *Fullenv) ClientConfig(name string) (string, error)

ClientConfig returns the configuration path of a given client

func (*Fullenv) Error

func (fe *Fullenv) Error() error

func (*Fullenv) LoadClient

func (fe *Fullenv) LoadClient(name string) (*xbus.Client, error)

LoadClient loads a client instance

func (*Fullenv) LoadClientConfig

func (fe *Fullenv) LoadClientConfig(name string) (xbus.COptions, error)

LoadClientConfig load the xbus.COptions of a client

func (*Fullenv) SetVar

func (fe *Fullenv) SetVar(key, value string)

SetVar sets a substitution variable

func (*Fullenv) SetVars

func (fe *Fullenv) SetVars(values map[string]string)

SetVars sets substitution variables

func (*Fullenv) Start

func (fe *Fullenv) Start() error

Start runs 'xbus-fullenv run' and keep it opened for further interaction

func (*Fullenv) StartClients

func (fe *Fullenv) StartClients() error

StartClients sends the 'startup' command to xbus-fullenv

func (*Fullenv) Stop

func (fe *Fullenv) Stop() error

Stop stops the fullenv

type MatchMessage

type MatchMessage func(string) bool

MatchMessage is a function that match a log message

type TestLogger

type TestLogger struct {
	// contains filtered or unexported fields
}

TestLogger is a BusLogger for tests

func GetTestLogger

func GetTestLogger(t testing.TB) *TestLogger

GetTestLogger returns a new BusLogger for the passed testing.T

func (TestLogger) Debugf

func (m TestLogger) Debugf(format string, v ...interface{})

Debugf passes the message to T.Logf

func (*TestLogger) Errorf

func (m *TestLogger) Errorf(format string, v ...interface{})

Errorf passes the message to T.Errorf

func (*TestLogger) ExpectsError

func (m *TestLogger) ExpectsError(expectedError interface{})

ExpectsError anticipate an error and make it non-fatal to the test

func (TestLogger) Fatalf

func (m TestLogger) Fatalf(format string, v ...interface{})

Fatalf passes the message to T.Fatalf

func (TestLogger) Noticef

func (m TestLogger) Noticef(format string, v ...interface{})

Noticef passes the message to T.Logf

func (TestLogger) Tracef

func (m TestLogger) Tracef(format string, v ...interface{})

Tracef passes the message to T.Logf

func (TestLogger) VerifyExpectations

func (m TestLogger) VerifyExpectations()

VerifyExpectations enforce error expectations

Jump to

Keyboard shortcuts

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