tests

package
v0.19.0 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2018 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExecuteT added in v0.18.0

func ExecuteT(t *testing.T, cmd string) (out string)

Execute the command, return stdout, logging stdout/err to t.

func StatusOK added in v0.19.0

func StatusOK(statusCode int) bool

Whether or not an HTTP status code was "successful"

func WaitForHeight added in v0.18.0

func WaitForHeight(height int64, port string)

Wait for height from the LCD API on localhost

func WaitForHeightTM added in v0.19.0

func WaitForHeightTM(height int64, port string)

Wait for the given height from the Tendermint RPC on localhost

func WaitForNextHeightTM added in v0.19.0

func WaitForNextHeightTM(port string)

Wait for the next tendermint block from the Tendermint RPC on localhost

func WaitForRPC added in v0.18.0

func WaitForRPC(laddr string)

Wait for the RPC server to respond to /status

func WaitForStart added in v0.18.0

func WaitForStart(port string)

wait for tendermint to start

Types

type Process added in v0.18.0

type Process struct {
	ExecPath     string
	Args         []string
	Pid          int
	StartTime    time.Time
	EndTime      time.Time
	Cmd          *exec.Cmd        `json:"-"`
	ExitState    *os.ProcessState `json:"-"`
	WaitCh       chan struct{}    `json:"-"`
	StdinPipe    io.WriteCloser   `json:"-"`
	StdoutBuffer *bytes.Buffer    `json:"-"`
	StderrBuffer *bytes.Buffer    `json:"-"`
}

execution process

func GoExecuteT added in v0.18.0

func GoExecuteT(t *testing.T, cmd string) (proc *Process)

Execute the command, launch goroutines to log stdout/err to t. Caller should wait for .Wait() or .Stop() to terminate.

func StartProcess added in v0.18.0

func StartProcess(dir string, name string, args []string, outFile, errFile io.WriteCloser) (*Process, error)

dir: The working directory. If "", os.Getwd() is used. name: Command name args: Args to command. (should not include name) outFile, errFile: If not nil, will use, otherwise new Buffers will be allocated. Either way, Process.Cmd.StdoutPipe and Process.Cmd.StderrPipe will be nil respectively.

func (*Process) Stop added in v0.18.0

func (proc *Process) Stop(kill bool) error

stop the process

func (*Process) Wait added in v0.18.0

func (proc *Process) Wait()

wait for the process

Jump to

Keyboard shortcuts

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