Documentation ¶
Index ¶
- Constants
- func Contains(s, partial string) bool
- func HasTestVerboseFlag() bool
- type App
- func (a App) Binary() string
- func (a App) EditConfig(apply func(*chainconfig.Config))
- func (a App) EnableFaucet(coins, coinsMax []string) (faucetAddr string)
- func (a App) EnsureSteady()
- func (a App) RandomizeServerPorts() chainconfig.Host
- func (a App) Serve(msg string, options ...ExecOption) (ok bool)
- func (a *App) SetConfigPath(path string)
- func (a App) Simulate(numBlocks, blockSize int)
- func (a App) SourcePath() string
- func (a App) UseRandomHomeDir() (homeDirPath string)
- type AppOption
- type Env
- func (e Env) App(path string, options ...AppOption) App
- func (e Env) AppHome(name string) string
- func (e Env) Ctx() context.Context
- func (e Env) Exec(msg string, steps step.Steps, options ...ExecOption) (ok bool)
- func (e Env) HasFailed() bool
- func (e Env) Home() string
- func (e Env) IsAppServed(ctx context.Context, host chainconfig.Host) error
- func (e Env) IsFaucetServed(ctx context.Context, faucetClient cosmosfaucet.HTTPClient) error
- func (e Env) Must(ok bool)
- func (e Env) RequireExpectations()
- func (e Env) Scaffold(name string, flags ...string) App
- func (e Env) SetCleanup(f func())
- func (e Env) TmpDir() (path string)
- type ExecOption
Constants ¶
const ( IgniteApp = "ignite" Stargate = "stargate" )
const ServeTimeout = time.Minute * 15
Variables ¶
This section is empty.
Functions ¶
func HasTestVerboseFlag ¶ added in v0.24.0
func HasTestVerboseFlag() bool
Types ¶
type App ¶ added in v0.24.0
type App struct {
// contains filtered or unexported fields
}
func (App) Binary ¶ added in v0.24.0
Binary returns the binary name of the app. Can be executed directly w/o any path after app.Serve is called, since it should be in the $PATH.
func (App) EditConfig ¶ added in v0.24.0
func (a App) EditConfig(apply func(*chainconfig.Config))
func (App) EnableFaucet ¶ added in v0.24.0
EnableFaucet enables faucet by finding a random port for the app faucet and update config.yml with this port and provided coins options.
func (App) EnsureSteady ¶ added in v0.24.0
func (a App) EnsureSteady()
EnsureSteady ensures that app living at the path can compile and its tests are passing.
func (App) RandomizeServerPorts ¶ added in v0.24.0
func (a App) RandomizeServerPorts() chainconfig.Host
RandomizeServerPorts randomizes server ports for the app at path, updates its config.yml and returns new values.
func (App) Serve ¶ added in v0.24.0
func (a App) Serve(msg string, options ...ExecOption) (ok bool)
Serve serves an application lives under path with options where msg describes the execution from the serving action. unless calling with Must(), Serve() will not exit test runtime on failure.
func (*App) SetConfigPath ¶ added in v0.24.0
func (App) SourcePath ¶ added in v0.24.0
func (App) UseRandomHomeDir ¶ added in v0.24.0
UseRandomHomeDir sets in the blockchain config files generated temporary directories for home directories Returns the random home directory
type AppOption ¶ added in v0.24.0
type AppOption func(*App)
func AppConfigPath ¶ added in v0.24.0
func AppHomePath ¶ added in v0.24.0
type Env ¶
type Env struct {
// contains filtered or unexported fields
}
Env provides an isolated testing environment and what's needed to make it possible.
func (Env) Exec ¶
Exec executes a command step with options where msg describes the expectation from the test. unless calling with Must(), Exec() will not exit test runtime on failure.
func (Env) IsAppServed ¶
IsAppServed checks that app is served properly and servers are started to listening before ctx canceled.
func (Env) IsFaucetServed ¶
func (e Env) IsFaucetServed(ctx context.Context, faucetClient cosmosfaucet.HTTPClient) error
IsFaucetServed checks that faucet of the app is served properly
func (Env) Must ¶
Must fails the immediately if not ok. t.Fail() needs to be called for the failing tests before running Must().
func (Env) RequireExpectations ¶ added in v0.24.0
func (e Env) RequireExpectations()
func (Env) SetCleanup ¶
func (e Env) SetCleanup(f func())
SetCleanup registers a function to be called when the test (or subtest) and all its subtests complete.
type ExecOption ¶
type ExecOption func(*execOptions)
func ExecCtx ¶
func ExecCtx(ctx context.Context) ExecOption
ExecCtx sets cancelation context for the execution.
func ExecRetry ¶
func ExecRetry() ExecOption
ExecRetry retries command until it is successful before context is canceled.
func ExecShouldError ¶
func ExecShouldError() ExecOption
ExecShouldError sets the expectations of a command's execution to end with a failure.
func ExecStderr ¶
func ExecStderr(w io.Writer) ExecOption
ExecStderr captures stderr of an execution.
func ExecStdout ¶
func ExecStdout(w io.Writer) ExecOption
ExecStdout captures stdout of an execution.