Documentation ¶
Index ¶
- Constants
- type Env
- func (e Env) AppdHome(name string) string
- func (e Env) ConfigureFaucet(path string, configFile string, coins, coinsMax []string) string
- func (e Env) Ctx() context.Context
- func (e Env) EnsureAppIsSteady(appPath string)
- func (e Env) Exec(msg string, steps step.Steps, options ...ExecOption) (ok 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) RandomizeServerPorts(path string, configFile string) chainconfig.Host
- func (e Env) Scaffold(name string, flags ...string) (appPath string)
- func (e Env) Serve(msg, path, home, configPath string, options ...ExecOption) (ok bool)
- func (e Env) SetCleanup(f func())
- func (e Env) SetRandomHomeConfig(path string, configFile string)
- func (e Env) Simulate(appPath string, numBlocks, blockSize int)
- func (e Env) TmpDir() (path string)
- type ExecOption
Constants ¶
const ( ServeTimeout = time.Minute * 15 IgniteApp = "ignite" ConfigYML = "config.yml" )
const (
Stargate = "stargate"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
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) ConfigureFaucet ¶
ConfigureFaucet finds a random port for the app faucet and updates config.yml with this port and provided coins options
func (Env) EnsureAppIsSteady ¶
EnsureAppIsSteady ensures that app living at the path can compile and its tests are passing.
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) RandomizeServerPorts ¶
func (e Env) RandomizeServerPorts(path string, configFile string) chainconfig.Host
RandomizeServerPorts randomizes server ports for the app at path, updates its config.yml and returns new values.
func (Env) Serve ¶
func (e Env) Serve(msg, path, home, configPath 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 (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.
func (Env) SetRandomHomeConfig ¶
SetRandomHomeConfig sets in the blockchain config files generated temporary directories for home directories
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.