testquery

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: 9 Imported by: 0

Documentation

Overview

Package testquery implements the test query tool using tq.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Handler added in v0.33.0

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

Handler handles the test_query tool execution.

func Register

func Register(server *mcp.Server)

Register registers the tool with the server.

Types

type Params

type Params struct {
	Dir     string `json:"dir" jsonschema:"The absolute directory path to analyze. Required."`
	Query   string `json:"query" jsonschema:"SQL query to run against test results (e.g. SELECT * FROM all_tests)"`
	Pkg     string `json:"pkg,omitempty" jsonschema:"Go package pattern to analyze (default: ./...)"`
	Rebuild bool   `json:"rebuild,omitempty" jsonschema:"Force rebuild of test database before querying."`
}

Params defines the input parameters.

type Runner added in v0.33.0

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 commands.

var CommandRunner Runner = &stdRunner{}

CommandRunner is used to execute CLI commands.

Jump to

Keyboard shortcuts

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