Documentation
¶
Overview ¶
Package clie2e contains end-to-end tests for lark-cli.
Index ¶
Constants ¶
View Source
const EnvBinaryPath = "LARK_CLI_BIN"
Variables ¶
This section is empty.
Functions ¶
func ResolveBinaryPath ¶
ResolveBinaryPath finds the CLI binary path using request, env, then PATH.
Types ¶
type Request ¶
type Request struct {
// Args are required and exclude the lark-cli binary name.
Args []string
// Params is optional and becomes --params '<json>' when non-nil.
Params any
// Data is optional and becomes --data '<json>' when non-nil.
Data any
// BinaryPath is optional. Empty means: LARK_CLI_BIN, project-root ./lark-cli, then PATH.
BinaryPath string
// DefaultAs is optional and becomes --as <value> when non-empty.
DefaultAs string
// Format is optional and becomes --format <format> when non-empty.
Format string
}
Request describes one lark-cli invocation.
type Result ¶
type Result struct {
BinaryPath string
Args []string
ExitCode int
Stdout string
Stderr string
RunErr error
}
Result captures process execution output.
func (*Result) AssertExitCode ¶
AssertExitCode asserts the exit code.
func (*Result) AssertStdoutStatus ¶
AssertStdoutStatus asserts stdout JSON status using either {"ok": ...} or {"code": ...}. This intentionally keeps one shared assertion entrypoint for CLI E2E call sites, so tests can stay uniform across shortcut-style {"ok": ...} responses and service-style {"code": ...} responses without branching on response shape.
func (*Result) StderrJSON ¶
StderrJSON decodes stderr as JSON.
Click to show internal directories.
Click to hide internal directories.