tests

package
v0.32.0 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2026 License: Apache-2.0 Imports: 37 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ClientId = os.Getenv("CLIENT_ID")
View Source
var ServiceAccountEmail = os.Getenv("SERVICE_ACCOUNT_EMAIL")

Functions

func AddExecuteSqlConfig

func AddExecuteSqlConfig(t *testing.T, config map[string]any, toolType string) map[string]any

AddExecuteSqlConfig gets the tools config for `execute-sql` tools

func AddMSSQLExecuteSqlConfig

func AddMSSQLExecuteSqlConfig(t *testing.T, config map[string]any) map[string]any

AddMSSQLExecuteSqlConfig gets the tools config for `mssql-execute-sql`

func AddMSSQLPrebuiltToolConfig

func AddMSSQLPrebuiltToolConfig(t *testing.T, config map[string]any) map[string]any

AddMSSQLPrebuiltToolConfig gets the tools config for mssql prebuilt tools

func AddMySQLPrebuiltToolConfig

func AddMySQLPrebuiltToolConfig(t *testing.T, config map[string]any) map[string]any

AddMySQLPrebuiltToolConfig gets the tools config for mysql prebuilt tools

func AddMySqlExecuteSqlConfig

func AddMySqlExecuteSqlConfig(t *testing.T, config map[string]any) map[string]any

AddMySqlExecuteSqlConfig gets the tools config for `mysql-execute-sql`

func AddPostgresPrebuiltConfig

func AddPostgresPrebuiltConfig(t *testing.T, config map[string]any) map[string]any

func AddSemanticSearchConfig

func AddSemanticSearchConfig(t *testing.T, config map[string]any, toolKind, insertStmt, searchStmt string) map[string]any

AddSemanticSearchConfig adds embedding models and semantic search tools to the config with configurable tool kind and SQL statements.

func AddTemplateParamConfig

func AddTemplateParamConfig(t *testing.T, config map[string]any, toolType, tmplSelectCombined, tmplSelectFilterCombined string, tmplSelectAll string) map[string]any

func AssertMCPError

func AssertMCPError(t *testing.T, mcpResp *MCPCallToolResponse, wantErrMsg string)

AssertMCPError asserts that the response contains an error covering the expected message.

func CleanupBigQueryDatasets

func CleanupBigQueryDatasets(t *testing.T, ctx context.Context, client *bigquery.Client, datasetIDs []string)

func CleanupBigtableTables

func CleanupBigtableTables(t *testing.T, ctx context.Context, adminClient *bigtable.AdminClient, uniqueID string)

finds and deletes all tables in a Bigtable instance that match the uniqueID.

func CleanupMSSQLTables

func CleanupMSSQLTables(t *testing.T, ctx context.Context, pool *sql.DB)

Finds and drops all tables in an mssql database.

func CleanupMySQLTables

func CleanupMySQLTables(t *testing.T, ctx context.Context, pool *sql.DB)

Finds and drops all tables in a mysql database.

func CleanupPostgresTables

func CleanupPostgresTables(t *testing.T, ctx context.Context, pool *pgxpool.Pool, uniqueID string)

Finds and drops all tables in a postgres database.

func CreateAndLockPostgresTable

func CreateAndLockPostgresTable(t *testing.T, ctx context.Context, pool *pgxpool.Pool, tableName string) func()

func GetCloudSQLDialOpts

func GetCloudSQLDialOpts(ipType string) ([]cloudsqlconn.DialOption, error)

GetCloudSQLDialOpts returns cloud sql connector's dial option for ip type.

func GetCockroachDBAuthToolInfo

func GetCockroachDBAuthToolInfo(tableName string) (string, string, string, []any)

GetCockroachDBAuthToolInfo returns statements and param of my-auth-tool for cockroachdb-sql type Uses explicit INT PRIMARY KEY instead of SERIAL to ensure deterministic IDs

func GetCockroachDBParamToolInfo

func GetCockroachDBParamToolInfo(tableName string) (string, string, string, string, string, string, []any)

GetCockroachDBParamToolInfo returns statements and param for my-tool cockroachdb-sql type Uses explicit INT PRIMARY KEY instead of SERIAL to ensure deterministic IDs

func GetCockroachDBWants

func GetCockroachDBWants() (string, string, string, string)

GetCockroachDBWants return the expected wants for cockroachdb

func GetGoogleIdToken

func GetGoogleIdToken(t *testing.T) (string, error)

GetGoogleIdToken retrieve and return the Google ID token

func GetMCPToolsList

func GetMCPToolsList(t *testing.T, requestHeader map[string]string) (int, []any, error)

GetMCPToolsList is a JSON-RPC harness that fetches the tools/list registry.

func GetMSSQLAuthToolInfo

func GetMSSQLAuthToolInfo(tableName string) (string, string, string, []any)

GetMSSQLAuthToolInfo returns statements and param of my-auth-tool for mssql-sql type

func GetMSSQLParamToolInfo

func GetMSSQLParamToolInfo(tableName string) (string, string, string, string, string, string, []any)

GetMSSQLParamToolInfo returns statements and param for my-tool mssql-sql type

func GetMSSQLTmplToolStatement

func GetMSSQLTmplToolStatement() (string, string)

GetMSSQLTmplToolStatement returns statements and param for template parameter test cases for mysql-sql type

func GetMSSQLWants

func GetMSSQLWants() (string, string, string, string)

GetMSSQLWants return the expected wants for mssql

func GetMySQLAuthToolInfo

func GetMySQLAuthToolInfo(tableName string) (string, string, string, []any)

GetMySQLAuthToolInfo returns statements and param of my-auth-tool for mysql-sql type

func GetMySQLParamToolInfo

func GetMySQLParamToolInfo(tableName string) (string, string, string, string, string, string, []any)

GetMySQLParamToolInfo returns statements and param for my-tool mysql-sql type

func GetMySQLTmplToolStatement

func GetMySQLTmplToolStatement() (string, string)

GetMySQLTmplToolStatement returns statements and param for template parameter test cases for mysql-sql type

func GetMySQLWants

func GetMySQLWants() (string, string, string, string)

GetMySQLWants return the expected wants for mysql

func GetPostgresSQLAuthToolInfo

func GetPostgresSQLAuthToolInfo(tableName string) (string, string, string, []any)

GetPostgresSQLAuthToolInfo returns statements and param of my-auth-tool for postgres-sql type

func GetPostgresSQLParamToolInfo

func GetPostgresSQLParamToolInfo(tableName string) (string, string, string, string, string, string, []any)

GetPostgresSQLParamToolInfo returns statements and param for my-tool postgres-sql type

func GetPostgresSQLTmplToolStatement

func GetPostgresSQLTmplToolStatement() (string, string)

GetPostgresSQLTmplToolStatement returns statements and param for template parameter test cases for postgres-sql type

func GetPostgresVectorSearchStmts

func GetPostgresVectorSearchStmts(vectorTableName string) (string, string)

func GetPostgresWants

func GetPostgresWants() (string, string, string, string)

GetPostgresWants return the expected wants for postgres

func GetRedisValkeyToolsConfig

func GetRedisValkeyToolsConfig(sourceConfig map[string]any, toolType string) map[string]any

func GetRedisValkeyWants

func GetRedisValkeyWants() (string, string, string, string, string, string, string)

GetRedisWants return the expected wants for redis

func GetToolsConfig

func GetToolsConfig(sourceConfig map[string]any, toolType, paramToolStatement, idParamToolStmt, nameParamToolStmt, arrayToolStatement, authToolStatement string) map[string]any

GetToolsConfig returns a mock tools config file

func NewMCPRequestHeader

func NewMCPRequestHeader(t *testing.T, customHeaders map[string]string) map[string]string

NewMCPRequestHeader takes custom headers and appends headers required for MCP.

func RunExecuteSqlToolInvokeTest

func RunExecuteSqlToolInvokeTest(t *testing.T, createTableStatement, select1Want string, options ...ExecuteSqlOption)

func RunInitialize

func RunInitialize(t *testing.T, protocolVersion string) string

RunInitialize runs the initialize lifecycle for mcp to set up client-server connection

func RunMCPCustomToolCallMethod

func RunMCPCustomToolCallMethod(t *testing.T, toolName string, arguments map[string]any, want string)

RunMCPCustomToolCallMethod invokes a tool and compares the result with expected output.

func RunMCPToolCallMethod

func RunMCPToolCallMethod(t *testing.T, myFailToolWant, select1Want string, options ...McpTestOption)

RunMCPToolCallMethod runs the tool/call for mcp endpoint

func RunMCPToolInvokeTest

func RunMCPToolInvokeTest(t *testing.T, select1Want string, options ...InvokeTestOption)

RunMCPToolInvokeTest runs the tool invoke test cases over MCP protocol.

func RunMCPToolsListMethod

func RunMCPToolsListMethod(t *testing.T, expectedOutput []MCPToolManifest)

RunMCPToolsListMethod calls tools/list and verifies that the returned tools match the expected list.

func RunMSSQLListTablesTest

func RunMSSQLListTablesTest(t *testing.T, tableNameParam, tableNameAuth string)

RunMSSQLListTablesTest run tests againsts the mssql-list-tables tools.

func RunMySQLGetQueryPlanTest

func RunMySQLGetQueryPlanTest(t *testing.T, ctx context.Context, pool *sql.DB, databaseName, tableNameParam string)

func RunMySQLListActiveQueriesTest

func RunMySQLListActiveQueriesTest(t *testing.T, ctx context.Context, pool *sql.DB)

RunMySQLListActiveQueriesTest run tests against the mysql-list-active-queries tests

func RunMySQLListTableFragmentationTest

func RunMySQLListTableFragmentationTest(t *testing.T, databaseName, tableNameParam, tableNameAuth string)

func RunMySQLListTablesMissingUniqueIndexes

func RunMySQLListTablesMissingUniqueIndexes(t *testing.T, ctx context.Context, pool *sql.DB, databaseName string)

func RunMySQLListTablesTest

func RunMySQLListTablesTest(t *testing.T, databaseName, tableNameParam, tableNameAuth, expectedOwner string)

RunMySQLListTablesTest run tests against the mysql-list-tables tool

func RunPostgresDatabaseOverviewTest

func RunPostgresDatabaseOverviewTest(t *testing.T, ctx context.Context, pool *pgxpool.Pool)

func RunPostgresGetColumnCardinalityTest

func RunPostgresGetColumnCardinalityTest(t *testing.T, ctx context.Context, pool *pgxpool.Pool)

func RunPostgresListActiveQueriesTest

func RunPostgresListActiveQueriesTest(t *testing.T, ctx context.Context, pool *pgxpool.Pool)

func RunPostgresListAvailableExtensionsTest

func RunPostgresListAvailableExtensionsTest(t *testing.T)

func RunPostgresListDatabaseStatsTest

func RunPostgresListDatabaseStatsTest(t *testing.T, ctx context.Context, pool *pgxpool.Pool)

RunPostgresDatabaseStatsTest tests the database_stats tool by comparing API results against a direct query to the database.

func RunPostgresListIndexesTest

func RunPostgresListIndexesTest(t *testing.T, ctx context.Context, pool *pgxpool.Pool)

func RunPostgresListInstalledExtensionsTest

func RunPostgresListInstalledExtensionsTest(t *testing.T)

func RunPostgresListLocksTest

func RunPostgresListLocksTest(t *testing.T, ctx context.Context, pool *pgxpool.Pool)

RunPostgresListLocksTest runs tests for the postgres list-locks tool

func RunPostgresListPgSettingsTest

func RunPostgresListPgSettingsTest(t *testing.T, ctx context.Context, pool *pgxpool.Pool)

func RunPostgresListPublicationTablesTest

func RunPostgresListPublicationTablesTest(t *testing.T, ctx context.Context, pool *pgxpool.Pool)

func RunPostgresListQueryStatsTest

func RunPostgresListQueryStatsTest(t *testing.T, ctx context.Context, pool *pgxpool.Pool)

func RunPostgresListRolesTest

func RunPostgresListRolesTest(t *testing.T, ctx context.Context, pool *pgxpool.Pool)

func RunPostgresListSchemasTest

func RunPostgresListSchemasTest(t *testing.T, ctx context.Context, pool *pgxpool.Pool, owner string, uniqueID string)

func RunPostgresListSequencesTest

func RunPostgresListSequencesTest(t *testing.T, ctx context.Context, pool *pgxpool.Pool)

func RunPostgresListStoredProcedureTest

func RunPostgresListStoredProcedureTest(t *testing.T, ctx context.Context, pool *pgxpool.Pool)

RunPostgresListStoredProcedureTest runs tests for the postgres list-stored-procedure tool

func RunPostgresListTableSpacesTest

func RunPostgresListTableSpacesTest(t *testing.T)

func RunPostgresListTableStatsTest

func RunPostgresListTableStatsTest(t *testing.T, ctx context.Context, pool *pgxpool.Pool)

RunPostgresListTableStatsTest runs tests for the postgres list-table-stats tool

func RunPostgresListTablesTest

func RunPostgresListTablesTest(t *testing.T, tableNameParam, tableNameAuth, user string)

func RunPostgresListTriggersTest

func RunPostgresListTriggersTest(t *testing.T, ctx context.Context, pool *pgxpool.Pool)

func RunPostgresListViewsTest

func RunPostgresListViewsTest(t *testing.T, ctx context.Context, pool *pgxpool.Pool)

func RunPostgresLongRunningTransactionsTest

func RunPostgresLongRunningTransactionsTest(t *testing.T, ctx context.Context, pool *pgxpool.Pool)

RunPostgresLongRunningTransactionsTest runs tests for the postgres long-running-transactions tool

func RunPostgresReplicationStatsTest

func RunPostgresReplicationStatsTest(t *testing.T, ctx context.Context, pool *pgxpool.Pool)

RunPostgresReplicationStatsTest runs tests for the postgres replication-stats tool

func RunRequest

func RunRequest(t *testing.T, method, url string, body io.Reader, headers map[string]string) (*http.Response, []byte)

RunRequest is a helper function to send HTTP requests and return the response

func RunSemanticSearchToolInvokeTest

func RunSemanticSearchToolInvokeTest(t *testing.T, insertWant, mcpInsertWant, searchWant string)

RunSemanticSearchToolInvokeTest runs the insert_docs and search_docs tools via both HTTP and MCP endpoints and verifies the output.

func RunSourceConnectionTest

func RunSourceConnectionTest(t *testing.T, sourceConfig map[string]any, toolType string) error

RunSourceConnection test for source connection

func RunStatementToolsTest

func RunStatementToolsTest(t *testing.T, tools map[string]string)

func RunToolGetTest

func RunToolGetTest(t *testing.T)

RunToolGet runs the tool get endpoint

func RunToolGetTestByName

func RunToolGetTestByName(t *testing.T, name string, want map[string]any)

func RunToolInvokeParametersTest

func RunToolInvokeParametersTest(t *testing.T, name string, params []byte, simpleWant string)

func RunToolInvokeSimpleTest

func RunToolInvokeSimpleTest(t *testing.T, name string, simpleWant string)

RunToolInvokeSimpleTest runs the tool invoke endpoint with no parameters

func RunToolInvokeTest

func RunToolInvokeTest(t *testing.T, select1Want string, options ...InvokeTestOption)

RunToolInvoke runs the tool invoke endpoint

func RunToolInvokeWithTemplateParameters

func RunToolInvokeWithTemplateParameters(t *testing.T, tableName string, options ...TemplateParamOption)

RunToolInvokeWithTemplateParameters runs tool invoke test cases with template parameters.

func SetupMsSQLTable

func SetupMsSQLTable(t *testing.T, ctx context.Context, pool *sql.DB, createStatement, insertStatement, tableName string, params []any) func(*testing.T)

SetupMsSQLTable creates and inserts data into a table of tool compatible with mssql-sql tool

func SetupMySQLTable

func SetupMySQLTable(t *testing.T, ctx context.Context, pool *sql.DB, createStatement, insertStatement, tableName string, params []any) func(*testing.T)

SetupMySQLTable creates and inserts data into a table of tool compatible with mysql-sql tool

func SetupPostgresSQLTable

func SetupPostgresSQLTable(t *testing.T, ctx context.Context, pool *pgxpool.Pool, createStatement, insertStatement, tableName string, params []any) func(*testing.T)

SetupPostgresSQLTable creates and inserts data into a table of tool compatible with postgres-sql tool

func SetupPostgresVectorTable

func SetupPostgresVectorTable(t *testing.T, ctx context.Context, pool *pgxpool.Pool) (string, func(*testing.T))

SetupPostgresVectorTable sets up the vector extension and a vector table

func TestCloudSQLMySQL_IPTypeParsingFromYAML

func TestCloudSQLMySQL_IPTypeParsingFromYAML(t *testing.T)

TestCloudSQLMySQL_IPTypeParsingFromYAML verifies the IPType field parsing from YAML for the cloud-sql-mysql source, mimicking the structure of tests in cloudsql_mysql_test.go.

Types

type CallToolParams

type CallToolParams struct {
	Name      string         `json:"name"`
	Arguments map[string]any `json:"arguments,omitempty"`
}

CallToolParams represents the internal payload of an MCP tool call request

type CmdExec

type CmdExec struct {
	Out io.ReadCloser
	// contains filtered or unexported fields
}

CmdExec represents an invocation of a toolbox command.

func StartCmd

func StartCmd(ctx context.Context, toolsFile map[string]any, args ...string) (*CmdExec, func(), error)

StartCmd returns a CmdExec representing a running instance of a toolbox command.

func (*CmdExec) Close

func (c *CmdExec) Close()

Close releases any resources associated with the instance.

func (*CmdExec) Done

func (c *CmdExec) Done() bool

Done returns true if the command has exited.

func (*CmdExec) Stop

func (c *CmdExec) Stop()

Stop sends the TERM signal to the cmd and returns.

func (*CmdExec) Wait

func (c *CmdExec) Wait(ctx context.Context) error

Waits until the execution is completed and returns any error from the result.

type ExecuteSqlOption

type ExecuteSqlOption func(*ExecuteSqlTestConfig)

func WithExecuteCreateWant

func WithExecuteCreateWant(s string) ExecuteSqlOption

WithExecuteCreateWant represents the expected response for a CREATE TABLE statement.

func WithExecuteDropWant

func WithExecuteDropWant(s string) ExecuteSqlOption

WithExecuteDropWant represents the expected response for a DROP TABLE statement.

func WithExecuteSelectEmptyWant

func WithExecuteSelectEmptyWant(s string) ExecuteSqlOption

WithExecuteSelectEmptyWant represents the expected response for a SELECT from an empty table.

func WithSelect1Statement

func WithSelect1Statement(s string) ExecuteSqlOption

WithSelect1Statement represents the database's statement for `SELECT 1`. e.g. tests.RunExecuteSqlToolInvokeTest(t, createTableStatement, select1Want, tests.WithSelect1Statement("custom"))

type ExecuteSqlTestConfig

type ExecuteSqlTestConfig struct {
	// contains filtered or unexported fields
}

ExecuteSqlTestConfig represents the various configuration options for RunExecuteSqlToolInvokeTest()

type InvokeTestConfig

type InvokeTestConfig struct {
	// contains filtered or unexported fields
}

InvokeTestConfig represents the various configuration options for RunToolInvokeTest()

type InvokeTestOption

type InvokeTestOption func(*InvokeTestConfig)

func DisableArrayTest

func DisableArrayTest() InvokeTestOption

DisableArrayTest disables tests for sources that do not support array. e.g. tests.RunToolInvokeTest(t, select1Want, tests.DisableArrayTest())

func DisableOptionalNullParamTest

func DisableOptionalNullParamTest() InvokeTestOption

DisableOptionalNullParamTest disables tests for optional null parameters. e.g. tests.RunToolInvokeTest(t, select1Want, tests.DisableOptionalNullParamTest())

func DisableSelect1AuthTest

func DisableSelect1AuthTest() InvokeTestOption

DisableSelect1AuthTest disables auth tests for sources that do not support SELECT 1 query. e.g. tests.RunToolInvokeTest(t, "", tests.DisableSelect1AuthTest())

func DisableSelect1Test

func DisableSelect1Test() InvokeTestOption

DisableSelect1Test disables tests for sources that do not support SELECT 1 query. e.g. tests.RunToolInvokeTest(t, "", tests.DisableSelect1Test())

func EnableClientAuthTest

func EnableClientAuthTest() InvokeTestOption

EnableClientAuthTest runs the client authorization tests. Only enable it if your source supports the `useClientOAuth` configuration. Currently, this should only be used with the BigQuery tests.

func WithMyArrayToolWant

func WithMyArrayToolWant(s string) InvokeTestOption

WithMyArrayToolWant represents the response value for my-array-tool. e.g. tests.RunToolInvokeTest(t, select1Want, tests.WithMyArrayToolWant("custom"))

func WithMyAuthToolWant

func WithMyAuthToolWant(s string) InvokeTestOption

WithMyAuthToolWant represents the response value for my-auth-tool. e.g. tests.RunToolInvokeTest(t, select1Want, tests.WithMyAuthToolWant("custom"))

func WithMyToolById4Want

func WithMyToolById4Want(s string) InvokeTestOption

WithMyToolById4Want represents the response value for my-tool-by-id with id=4. This response includes a null value column. e.g. tests.RunToolInvokeTest(t, select1Want, tests.WithMyToolById4Want("custom"))

func WithMyToolId3NameAliceWant

func WithMyToolId3NameAliceWant(s string) InvokeTestOption

WithMyToolId3NameAliceWant represents the response value for my-tool with id=3 and name=Alice. e.g. tests.RunToolInvokeTest(t, select1Want, tests.WithMyToolId3NameAliceWant("custom"))

func WithNullWant

func WithNullWant(s string) InvokeTestOption

WithNullWant represents a response value of null string. e.g. tests.RunToolInvokeTest(t, select1Want, tests.WithNullWant("custom"))

type MCPCallToolRequest

type MCPCallToolRequest struct {
	Jsonrpc string            `json:"jsonrpc"`
	Id      jsonrpc.RequestId `json:"id"`
	Method  string            `json:"method"`
	Params  CallToolParams    `json:"params"`
}

MCPCallToolRequest encapsulates the standard JSON-RPC request format targeting tools/call

func NewMCPCallToolRequest

func NewMCPCallToolRequest(id jsonrpc.RequestId, toolName string, args map[string]any) MCPCallToolRequest

NewMCPCallToolRequest is a helper to quickly generate a standard jsonrpc request payload.

type MCPCallToolResponse

type MCPCallToolResponse struct {
	Jsonrpc string                   `json:"jsonrpc"`
	Id      jsonrpc.RequestId        `json:"id"`
	Result  v20251125.CallToolResult `json:"result,omitempty"`
	Error   *jsonrpc.Error           `json:"error,omitempty"`
}

MCPCallToolResponse provides a strongly-typed unmarshal target for MCP tool call results, bypassing the generic interface{} Result used in the standard jsonrpc.JSONRPCResponse.

func InvokeMCPTool

func InvokeMCPTool(t *testing.T, toolName string, arguments map[string]any, requestHeader map[string]string) (int, *MCPCallToolResponse, error)

InvokeMCPTool is a transparent, native JSON-RPC execution harness for tests.

type MCPListToolsRequest

type MCPListToolsRequest struct {
	Jsonrpc string            `json:"jsonrpc"`
	Id      jsonrpc.RequestId `json:"id"`
	Method  string            `json:"method"`
}

MCPListToolsRequest encapsulates the standard JSON-RPC request format targeting tools/list

type MCPListToolsResponse

type MCPListToolsResponse struct {
	Jsonrpc string            `json:"jsonrpc"`
	Id      jsonrpc.RequestId `json:"id"`
	Result  struct {
		Tools []MCPToolManifest `json:"tools"`
	} `json:"result,omitempty"`
	Error *jsonrpc.Error `json:"error,omitempty"`
}

MCPListToolsResponse is a strongly-typed unmarshal target for tools/list results

type MCPTestConfig

type MCPTestConfig struct {
	// contains filtered or unexported fields
}

MCPTestConfig represents the various configuration options for mcp tool call tests.

type MCPToolManifest

type MCPToolManifest struct {
	Name        string         `json:"name"`
	Description string         `json:"description,omitempty"`
	InputSchema map[string]any `json:"inputSchema,omitempty"`
}

MCPToolManifest is a copy of tools.McpManifest used for integration testing purposes

type McpTestOption

type McpTestOption func(*MCPTestConfig)

func DisableMcpSelect1AuthTest

func DisableMcpSelect1AuthTest() McpTestOption

DisableMcpSelect1AuthTest disables the auth tool tests which use select 1.

func EnableMcpClientAuthTest

func EnableMcpClientAuthTest() McpTestOption

EnableMcpClientAuthTest runs the client authorization tests. Only enable it if your source supports the `useClientOAuth` configuration. Currently, this should only be used with the BigQuery tests.

func WithMcpMyToolId3NameAliceWant

func WithMcpMyToolId3NameAliceWant(s string) McpTestOption

WithMcpMyToolId3NameAliceWant represents the response value for my-tool with id=3 and name=Alice. e.g. tests.RunMCPToolCallMethod(t, mcpMyFailToolWant, tests.WithMcpMyToolId3NameAliceWant("custom"))

func WithMcpSelect1Want

func WithMcpSelect1Want(want string) McpTestOption

type TemplateParamOption

type TemplateParamOption func(*TemplateParameterTestConfig)

func DisableDdlTest

func DisableDdlTest() TemplateParamOption

DisableDdlTest disables tests for ddl statements for sources that do not support ddl. e.g. tests.RunToolInvokeWithTemplateParameters(t, tableNameTemplateParam, tests.DisableDdlTest())

func DisableInsertTest

func DisableInsertTest() TemplateParamOption

DisableInsertTest disables tests of insert statements for sources that do not support insert. e.g. tests.RunToolInvokeWithTemplateParameters(t, tableNameTemplateParam, tests.DisableInsertTest())

func DisableSelectFilterTest

func DisableSelectFilterTest() TemplateParamOption

DisableInsertTest disables tests of select-fields-templateParams-tool test. e.g. tests.RunToolInvokeWithTemplateParameters(t, tableNameTemplateParam, tests.DisableSelectFilterTest())

func WithCreateColArray

func WithCreateColArray(s string) TemplateParamOption

WithCreateColArray represents the columns array parameter for create-table-templateParams-tool. e.g. tests.RunToolInvokeWithTemplateParameters(t, tableNameTemplateParam, tests.WithCreateColArray("custom"))

func WithDdlWant

func WithDdlWant(s string) TemplateParamOption

WithDdlWant represents the response value of ddl statements. e.g. tests.RunToolInvokeWithTemplateParameters(t, tableNameTemplateParam, tests.WithDdlWant("custom"))

func WithInsert1Want

func WithInsert1Want(s string) TemplateParamOption

WithInsert1Want represents the response value of insert-table-templateParams-tool. e.g. tests.RunToolInvokeWithTemplateParameters(t, tableNameTemplateParam, tests.WithInsert1Want("custom"))

func WithNameColFilter

func WithNameColFilter(s string) TemplateParamOption

WithNameColFilter represents the columnFilter parameter for select-filter-templateParams-combined-tool. e.g. tests.RunToolInvokeWithTemplateParameters(t, tableNameTemplateParam, tests.WithNameColFilter("custom"))

func WithNameFieldArray

func WithNameFieldArray(s string) TemplateParamOption

WithNameFieldArray represents fields array parameter for select-fields-templateParams-tool. e.g. tests.RunToolInvokeWithTemplateParameters(t, tableNameTemplateParam, tests.WithNameFieldArray("custom"))

func WithSelectAllWant

func WithSelectAllWant(s string) TemplateParamOption

WithSelectAllWant represents the response value of select-templateParams-tool. e.g. tests.RunToolInvokeWithTemplateParameters(t, tableNameTemplateParam, tests.WithSelectAllWant("custom"))

func WithSelectEmptyWant

func WithSelectEmptyWant(s string) TemplateParamOption

WithSelectEmptyWant represents the response value of select-templateParams-combined-tool with no results. e.g. tests.RunToolInvokeWithTemplateParameters(t, tableNameTemplateParam, tests.WithSelectEmptyWant("custom"))

func WithTmplSelectId1Want

func WithTmplSelectId1Want(s string) TemplateParamOption

WithTmplSelectId1Want represents the response value of select-templateParams-combined-tool with id=1. e.g. tests.RunToolInvokeWithTemplateParameters(t, tableNameTemplateParam, tests.WithTmplSelectId1Want("custom"))

func WithTmplSelectNameWant

func WithTmplSelectNameWant(s string) TemplateParamOption

WithTmplSelectNameWant represents the response value of select-filter-templateParams-combined-tool with name. e.g. tests.RunToolInvokeWithTemplateParameters(t, tableNameTemplateParam, tests.WithTmplSelectNameWant("custom"))

type TemplateParameterTestConfig

type TemplateParameterTestConfig struct {
	// contains filtered or unexported fields
}

TemplateParameterTestConfig represents the various configuration options for template parameter tests.

Jump to

Keyboard shortcuts

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