Documentation
¶
Index ¶
- Constants
- func GetKubeConfig() (*rest.Config, error)
- func MCPTestImage() string
- func NewHelmConfig(namespace string) (*action.Configuration, error)
- type Checker
- type ClusterValidator
- type ConfigChecker
- type MCPClient
- type ReleasesChecker
- type Result
- type Runner
- func (r *Runner) ConfigCreate(ctx context.Context) error
- func (r *Runner) ConfigDelete(ctx context.Context)
- func (r *Runner) Deploy(ctx context.Context) error
- func (r *Runner) Integration(ctx context.Context, module string, flags ...string) error
- func (r *Runner) StartMCPServer(ctx context.Context, image string) (*MCPClient, error)
- func (r *Runner) Topology(ctx context.Context) error
- type SecretsChecker
- type SharedContext
- type ToolResult
Constants ¶
const ( // ProjectRoot is the relative path from the test/e2e/cli package to the // repository root. Go test runners set the working directory to the // package under test, so all paths must be anchored relative to it. ProjectRoot = "../../.." // BinaryPath is the path to the helmet-ex binary relative to the // project root. BinaryPath = "example/helmet-ex/helmet-ex" // ConfigPath is the path to the test configuration file relative to the // project root. Passed to the binary which opens it via io/fs (no // absolute paths or ".." traversals allowed). ConfigPath = "test/config.yaml" )
Variables ¶
This section is empty.
Functions ¶
func GetKubeConfig ¶
GetKubeConfig loads kubeconfig from the KUBECONFIG environment variable or the default location (~/.kube/config).
func MCPTestImage ¶
func MCPTestImage() string
MCPTestImage returns the container image reference for the MCP server. Uses IMAGE environment varable if set, falls back to default.
func NewHelmConfig ¶
func NewHelmConfig(namespace string) (*action.Configuration, error)
NewHelmConfig creates a Helm action.Configuration for the specified namespace using the KUBECONFIG environment variable.
Types ¶
type ClusterValidator ¶
type ClusterValidator struct {
// contains filtered or unexported fields
}
ClusterValidator composes multiple checkers for comprehensive cluster state validation.
func NewClusterValidator ¶
func NewClusterValidator(checkers ...Checker) *ClusterValidator
NewClusterValidator creates a validator with the specified checkers.
type ConfigChecker ¶
type ConfigChecker struct {
// contains filtered or unexported fields
}
ConfigChecker validates the cluster configuration ConfigMap exists and contains product definitions.
func NewConfigChecker ¶
func NewConfigChecker( kubeClient kubernetes.Interface, namespace string, appName string, ) *ConfigChecker
NewConfigChecker creates a ConfigChecker for the specified application name.
type MCPClient ¶
type MCPClient struct {
// contains filtered or unexported fields
}
MCPClient communicates with a helmet-ex mcp-server subprocess via JSON-RPC 2.0 over STDIO. Created by Runner.StartMCPServer.
func NewMCPClient ¶
func NewMCPClient( cmd *exec.Cmd, stdin io.WriteCloser, reader *bufio.Reader, nextID int64, ) *MCPClient
NewMCPClient instantiates an MCPClient.
func (*MCPClient) CallTool ¶
CallTool invokes a tool by name with optional arguments. Tool errors arrive as ToolResult with IsError=true, not as Go errors. Go errors indicate protocol-level failures only; they are reported via Gomega Expect to fail the test immediately.
func (*MCPClient) Initialize ¶
Initialize performs the MCP initialize handshake. Must be called before any tool calls.
type ReleasesChecker ¶
type ReleasesChecker struct {
// contains filtered or unexported fields
}
ReleasesChecker validates Helm releases are installed and deployed in the correct topology order.
func NewReleasesChecker ¶
func NewReleasesChecker( helmConfig *action.Configuration, kubeClient kubernetes.Interface, namespace string, expectedOrder []string, ) *ReleasesChecker
NewReleasesChecker creates a ReleasesChecker. The expectedOrder slice defines the topology-sorted deployment order. The deploy-sequence ConfigMap name defaults to "deploy-sequence".
type Result ¶
type Result struct {
Passed bool // true if validation succeeded
Message string // descriptive message (error details if Passed=false)
}
Result represents the outcome of a checker validation.
func NewFailedResult ¶
NewFailedResult creates a failed result with an error message.
type Runner ¶
type Runner struct {
// contains filtered or unexported fields
}
Runner executes helmet-ex CLI commands in a subprocess. All paths (binary, config) are relative to the project root. The binary is launched with its working directory set to the project root so that the embedded ChartFS (io/fs based) can resolve paths correctly.
func NewRunner ¶
NewRunner creates a new CLI command runner. The projectRoot is used as the working directory for the child process; it is resolved to an absolute path so the runner works regardless of where the test binary executes.
func (*Runner) ConfigCreate ¶
ConfigCreate executes: "helmet-ex config --create --namespace <ns> <configPath>".
func (*Runner) ConfigDelete ¶
ConfigDelete executes: "helmet-ex config --delete". Errors are ignored so it can be called even when no config exists yet.
func (*Runner) Integration ¶
Integration executes: helmet-ex integration <module> <flags...>.
func (*Runner) StartMCPServer ¶
StartMCPServer launches the MCP server as a long-lived subprocess and returns a client connected to its STDIO pipes. The Runner's projectRoot and binaryPath are reused; the image argument is passed as --image to the mcp-server subcommand.
type SecretsChecker ¶
type SecretsChecker struct {
// contains filtered or unexported fields
}
SecretsChecker validates that integration Secrets exist in the target namespace.
func NewSecretsChecker ¶
func NewSecretsChecker( kubeClient kubernetes.Interface, namespace string, secretNames []string, ) *SecretsChecker
NewSecretsChecker creates a SecretsChecker for the specified secrets.
type SharedContext ¶
type SharedContext struct {
}
SharedContext holds common resources for E2E tests.
func NewSharedContext ¶
func NewSharedContext(namespace string) (*SharedContext, error)
NewSharedContext initializes the shared E2E test context. It verifies KUBECONFIG is set and creates Kubernetes clients.
type ToolResult ¶
type ToolResult struct {
mcp.CallToolResult
}
ToolResult wraps a CallToolResult with convenience accessors.
func (ToolResult) Text ¶
func (r ToolResult) Text() string
Text extracts the concatenated text from all TextContent entries. Returns empty string if no text content is present.