smarttest

package
v0.33.0 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2026 License: Apache-2.0 Imports: 9 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 {
	//nolint:lll
	Dir string `json:"dir" jsonschema:"The absolute directory path to test in. Required. Relative paths are rejected."`
	//nolint:lll
	Packages string `json:"packages,omitempty" jsonschema:"Packages to test (default: ./...)"`
	//nolint:lll
	Level string `` /* 244-byte string literal not displayed */
	//nolint:lll
	Run string `json:"run,omitempty" jsonschema:"Regex pattern to filter specific tests or benchmark functions (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