Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var BuildCommand = cli.Command{ Name: "build", Usage: "builds a test plan", Subcommands: cli.Commands{ cli.Command{ Name: "composition", Aliases: []string{"c"}, Usage: "Builds a composition.", Action: buildCompositionCmd, Flags: []cli.Flag{ cli.StringFlag{ Name: "file, f", Usage: "path to a composition `FILE`", }, cli.BoolFlag{ Name: "write-artifacts, w", Usage: "Writes the resulting build artifacts to the composition file.", }, }, }, cli.Command{ Name: "single", Aliases: []string{"s"}, Usage: "Builds a single group, passing in all necesssary input via CLI flags.", Action: buildSingleCmd, ArgsUsage: "[<testplan>]", Flags: []cli.Flag{ cli.StringFlag{ Name: "builder, b", Usage: "specifies the builder to use; values include: 'docker:go', 'exec:go'", }, cli.StringSliceFlag{ Name: "dep, d", Usage: "set a dependency mapping", }, cli.StringSliceFlag{ Name: "build-cfg", Usage: "set a build config parameter", }, }, }, }, }
View Source
var CollectCommand = cli.Command{ Name: "collect", Usage: "Produces a tgz file with the output from a certain run", Action: collectCommand, ArgsUsage: "[run_id]", Flags: []cli.Flag{ cli.StringFlag{ Name: "runner, r", Usage: "specifies the runner to use; values include: 'local:exec', 'local:docker', 'cluster:k8s'", Required: true, }, cli.StringFlag{ Name: "output, o", Usage: "specifies a named output for the tgz file", }, }, }
CollectCommand is the specification of the `collect` command.
View Source
var Commands = []cli.Command{ RunCommand, ListCommand, BuildCommand, DescribeCommand, SidecarCommand, DaemonCommand, CollectCommand, TerminateCommand, HealthcheckCommand, }
Commands collects all subcommands of the testground CLI.
View Source
var DaemonCommand = cli.Command{
Name: "daemon",
Usage: "start a long-running daemon process",
Action: daemonCommand,
}
DaemonCommand is the specification of the `daemon` command.
View Source
var DescribeCommand = cli.Command{ Name: "describe", Usage: "describes a test plan or test case", ArgsUsage: "[term], where " + daemon.TermExplanation, Action: describeCommand, }
DescribeCommand is the specification of the `list` command.
View Source
var ErrNotLinux = fmt.Errorf("the sidecar only supports linux, not %s", runtime.GOOS)
View Source
var Flags = []cli.Flag{ cli.BoolFlag{ Name: "v", Usage: "verbose output (equivalent to DEBUG log level)", }, cli.BoolFlag{ Name: "vv", Usage: "super verbose output (equivalent to DEBUG log level for now, it may accommodate TRACE in the future)", }, cli.StringFlag{ Name: "endpoint", Usage: "set the daemon endpoint URI (overrides .env.toml)", }, }
View Source
var HealthcheckCommand = cli.Command{ Name: "healthcheck", Usage: "checks, and optionally heals, the preconditions for the runner to be able to run properly", Action: healthcheckCommand, Flags: []cli.Flag{ cli.BoolFlag{ Name: "fix", Usage: "should try to fix the preconditions", }, cli.StringFlag{ Name: "runner", Usage: "specifies the runner to use; values include: 'local:exec', 'local:docker', 'cluster:k8s'", Required: true, }, }, }
View Source
var ListCommand = cli.Command{
Name: "list",
Usage: "list all test plans and test cases",
Action: listCommand,
}
ListCommand is the specification of the `list` command.
View Source
var RunCommand = cli.Command{ Name: "run", Usage: "(Builds and) runs a test case. List test cases with the `list` command.", Subcommands: cli.Commands{ cli.Command{ Name: "composition", Aliases: []string{"c"}, Usage: "(Builds and) runs a composition.", Action: runCompositionCmd, Flags: []cli.Flag{ cli.StringFlag{ Name: "file, f", Usage: "path to a composition `FILE`", }, cli.BoolFlag{ Name: "write-artifacts, w", Usage: "Writes the resulting build artifacts to the composition file.", }, cli.BoolFlag{ Name: "ignore-artifacts, i", Usage: "Ignores any build artifacts present in the composition file.", }, cli.BoolFlag{ Name: "collect", Usage: "Collect assets at the end of the run phase.", }, cli.StringFlag{ Name: "collect-file, o", Usage: "Destination for the assets if --collect is set", }, }, }, cli.Command{ Name: "single", Aliases: []string{"s"}, Usage: "(Builds and) runs a single group.", Action: runSingleCmd, ArgsUsage: "[name]", Flags: append( BuildCommand.Subcommands[1].Flags, cli.StringFlag{ Name: "runner, r", Usage: "specifies the runner to use; values include: 'local:exec', 'local:docker', 'cluster:k8s'", }, cli.StringFlag{ Name: "use-build, ub", Usage: "specifies the artifact to use (from a previous build)", }, cli.UintFlag{ Name: "instances, i", Usage: "number of instances of the test case to run", }, cli.StringSliceFlag{ Name: "run-cfg", Usage: "override runner configuration", }, cli.StringSliceFlag{ Name: "test-param, p", Usage: "provide a test parameter", }, cli.BoolFlag{ Name: "collect", Usage: "Collect assets at the end of the run phase.", }, cli.StringFlag{ Name: "collect-file, o", Usage: "Destination for the assets if --collect is set", }, ), }, }, }
RunCommand is the specification of the `run` command.
View Source
var SidecarCommand = cli.Command{ Name: "sidecar", Usage: "runs the sidecar daemon", Action: sidecarCommand, OnUsageError: func(c *cli.Context, err error, isSubcommand bool) error { if runtime.GOOS != "linux" { return ErrNotLinux } _, _ = fmt.Fprintf(c.App.Writer, "%s %s\n\n", "Incorrect Usage.", err.Error()) _ = cli.ShowAppHelp(c) return err }, Flags: []cli.Flag{ cli.GenericFlag{ Name: "runner, r", Required: true, Usage: `Specifies the runner that will be scheduling tasks that should be managed by this sidecar. Options: ` + strings.Join(sidecar.GetRunners(), ", "), Value: &EnumValue{ Allowed: sidecar.GetRunners(), }, }, cli.BoolFlag{ Name: "pprof", Usage: "Enable pprof service on port 6060", }, }, }
View Source
var TerminateCommand = cli.Command{ Name: "terminate", Usage: " terminates all jobs running on a runner", Action: terminateCommand, Flags: []cli.Flag{ cli.StringFlag{ Name: "runner", Usage: "specifies the runner to use; values include: 'local:exec', 'local:docker', 'cluster:k8s'", Required: true, }, }, }
Functions ¶
func ProcessContext ¶
Types ¶
Click to show internal directories.
Click to hide internal directories.