Documentation ¶
Index ¶
Constants ¶
const ( // When this environ var is set to a value and running tests with -v flag, // then Runner output is logged. EnvTestRunnerOutput = "TEST_RUNNER_OUTPUT" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CmdArgs ¶
type CmdArgs struct {
// contains filtered or unexported fields
}
CmdArgs contains a command name and any arguments.
type Runner ¶
Runner is a helper for running the indexer and other commands. Runner is not specifically tied to the indexer, but is designed to be used to manage multiple processes in a test; and is therefore useful for testing the indexer, the dhstore, and providers, all in a temporary directory and with a test environment.
func NewRunner ¶
NewRunner creates a new Runner for the given test, context, and temporary directory. It also takes a list of StdoutWatchers, which will be used to watch for specific output from the commands.
func (*Runner) Run ¶
Run runs a command and returns its output. This is useful for executing synchronous commands within the temporary environment.
type Watcher ¶ added in v0.0.4
type Watcher struct {
// contains filtered or unexported fields
}
Watcher is a helper for watching a command's output for a specific string. The watcher can watch stdout, stderr or both. It is used by Runner to watch for specific output from the commands. The Signal channel is signaled when the match string is found.
func NewStderrWatcher ¶ added in v0.0.4
NewStderrWatcher creates a Watcher that is signeled when matching a string from stderr.
func NewStdoutWatcher ¶
NewStdoutWatcher creates a Watcher that is signeled when matching a string from stdout.
func NewWatcher ¶ added in v0.0.4
NewWatcher creates a Watcher that is signeled when matching a string from stderr or stdout.