package
28.5.1
Repository: https://github.com/ignite/cli.git
Documentation: pkg.go.dev

# README

Ignite CLI Integration Tests

The Ignite CLI integration tests build a new application and run all Ignite CLI commands to check the Ignite CLI code integrity. The runners and helper methods are located in this current folder. The test commands are split into folders, for better concurrency, each folder is a parallel job into the CI workflow. To create a new one, we only need to create a new folder. This will be automatically detected and added into the PR CI checks, or we can only create new tests into an existing folder or file.

Running synchronously all integration tests can be very slow. The command below can run everything:

go test -v -timeout 120m ./integration

Or you can just run a specific test folder, like the list types test

go test -v -timeout 120m ./integration/list

Usage

  • Create a new env and scaffold an empty chain:
var (
 env  = envtest.New(t)
 path = env.Scaffold("github.com/test/blog")
)
  • Now, you can use the env to run the ignite commands and check the success status:
env.Must(env.Exec("create a list with bool",
    step.NewSteps(step.New(
        step.Exec(envtest.IgniteApp, "s", "list", "--yes", "document", "signed:bool"),
        step.Workdir(path),
    )),
))
env.EnsureSteady()
  • To check if the command returns an error, you can add the envtest.ExecShouldError() step:
env.Must(env.Exec("should prevent creating a list with duplicated fields",
    step.NewSteps(step.New(
        step.Exec(envtest.IgniteApp, "s", "list", "--yes", "company", "name", "name"),
        step.Workdir(path),
    )),
    envtest.ExecShouldError(),
))
env.EnsureSteady()

# Packages

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Functions

No description provided by the author
No description provided by the author
No description provided by the author
ClientEnv option defines environment values for the tests.
ClientTestFile option defines the name of the file where to look for tests.
ClientTestName option defines a pattern to match the test names that should be run.
ExecCtx sets cancelation context for the execution.
ExecRetry retries command until it is successful before context is canceled.
ExecShouldError sets the expectations of a command's execution to end with a failure.
ExecStderr captures stderr of an execution.
ExecStdout captures stdout of an execution.
No description provided by the author
New creates a new testing environment.

# Constants

No description provided by the author

# Variables

IgniteApp hold the location of the ignite binary used in the integration tests.

# Structs

No description provided by the author
Env provides an isolated testing environment and what's needed to make it possible.
Hosts contains the "hostname:port" addresses for different service hosts.

# Type aliases

No description provided by the author
ClientOption defines options for the TS client test runner.
No description provided by the author