smarttest

package
v0.34.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 17, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package smarttest implements the smart_test tool.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Handler

func Handler(ctx context.Context, _ *mcp.CallToolRequest, args Params) (*mcp.CallToolResult, any, error)

Handler executes the smart_test tool.

func Register

func Register(server *mcp.Server)

Register registers the tool with the MCP server.

Types

type Params

type Params struct {
	Dir      string `json:"dir" jsonschema:"The absolute directory path to test in. Required."`
	Packages string `json:"packages,omitempty" jsonschema:"Packages to test (default: ./...)"`
	Level    string `json:"level,omitempty" jsonschema:"Testing depth: 'fast', 'basic', 'benchmark', 'complete'"`
	Run      string `json:"run,omitempty" jsonschema:"Regex pattern to filter tests/benchmarks (maps to -run or -bench)"`
}

Params defines the input parameters for smart_test.

type Runner

type Runner interface {
	Run(ctx context.Context, dir, name string, args ...string) error
	RunWithOutput(ctx context.Context, dir, name string, args ...string) (string, error)
	LookPath(file string) (string, error)
}

Runner defines the interface for running CLI commands.

var CommandRunner Runner = &stdRunner{}

CommandRunner is used for executing CLI commands during testing or runtime.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL