testscenarios

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package testscenarios provides reusable Goa design scenarios for testing agent code generation.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AliasBoth

func AliasBoth() func()

AliasBoth returns a design where tool payload and result reuse the exact method user types, enabling full adapter bypass.

func AliasPayloadOnly

func AliasPayloadOnly() func()

AliasPayloadOnly returns a design where payload reuses the method payload user type but result is inline, requiring a result adapter.

func AliasResultOnly

func AliasResultOnly() func()

AliasResultOnly returns a design where result reuses the method result user type but payload is inline, requiring a payload adapter.

func ArgsInlineObject

func ArgsInlineObject() func()

ArgsInlineObject returns a DSL with inline object args and result.

func ArgsLocatedNestedUserType

func ArgsLocatedNestedUserType() func()

ArgsLocatedNestedUserType returns a DSL where the tool payload aliases a user type placed via struct:pkg:path (e.g. `types.*`) and that type references another user type.

With newer Goa versions, types that are forced into a located package must ensure their dependencies are explicitly located as well. This scenario exercises codegen for a tool payload whose nested references live in a non-default package.

func ArgsPrimitive

func ArgsPrimitive() func()

ArgsPrimitive returns a DSL with primitive args and result.

func ArgsUnionSumTypes

func ArgsUnionSumTypes() func()

ArgsUnionSumTypes returns a DSL with union (OneOf) args and result.

func ArgsUserType

func ArgsUserType() func()

ArgsUserType returns a DSL with user type args and result (service-local type).

func ConfirmationDSL

func ConfirmationDSL() func()

ConfirmationDSL returns a DSL design function for confirmation tool specs.

func DeepNestedValidations

func DeepNestedValidations() func()

DeepNestedValidations defines nested user types with validations at each level.

func ExportsSimple

func ExportsSimple() func()

ExportsSimple declares an agent that exports a single toolset with one tool.

func ExportsWithHints

func ExportsWithHints() func()

ExportsWithHints declares an exported toolset whose tool configures call and result hint templates.

func ImportsDeterministic

func ImportsDeterministic() func()

ImportsDeterministic uses a user type with a custom package path to exercise alias stability.

func MCPDSL

func MCPDSL() func()

MCPDSL references an external MCP toolset using the Toolset with FromMCP DSL.

func MCPUse

func MCPUse() func()

MCPUse references an external MCP toolset using Toolset with FromMCP.

func MCPUseAlias

func MCPUseAlias() func()

MCPUseAlias references an external MCP toolset through a local alias so the generator must keep definition-owned package names separate from provider metadata.

func MethodComplexEmbedded

func MethodComplexEmbedded() func()

MethodComplexEmbedded defines a method-bound tool with nested/embedded user types.

func MethodExternalAlias

func MethodExternalAlias() func()

MethodExternalAlias defines a method-bound tool whose result aliases a specs-local type while nesting a user type with a custom package path. It exercises transform initialization to ensure the top-level initializer uses the specs package while nested fields preserve external packages.

func MethodSimpleCompatible

func MethodSimpleCompatible() func()

MethodSimpleCompatible defines a simple method-bound tool whose shapes are compatible to trigger transform emission (Args -> Method Payload, Method Result -> Return).

func MultiToolset

func MultiToolset() func()

MultiToolset returns a DSL design with two toolsets under one agent to exercise the aggregated specs package importing multiple per-toolset packages.

func NoResultMethod

func NoResultMethod() func()

NoResultMethod returns a DSL design with a method-backed tool whose target service method returns only an error (no result). Tests assert service_toolset code generation handles no-result methods correctly.

func ReUse

func ReUse() func()

ReUse declares a top-level toolset and references it via Use.

func RunPolicyBasic

func RunPolicyBasic() func()

RunPolicyBasic returns a DSL design with caps, time budget, and interrupts.

func ServiceToolsetBindCross

func ServiceToolsetBindCross() func()

ServiceToolsetBindCross returns a DSL with an agent binding to another service method.

func ServiceToolsetBindSelf

func ServiceToolsetBindSelf() func()

ServiceToolsetBindSelf returns a DSL design function for a method-backed toolset within the same service.

func ServiceToolsetBindSelfBoundedResult

func ServiceToolsetBindSelfBoundedResult() func()

ServiceToolsetBindSelfBoundedResult returns a DSL design function for a method-backed bounded tool whose semantic result stays domain-only while the bound method result carries canonical bounds fields for projection.

func ServiceToolsetBindSelfHints

func ServiceToolsetBindSelfHints() func()

ServiceToolsetBindSelfHints returns a DSL design function for a method-backed used toolset that includes call and result hint templates.

func ServiceToolsetBindSelfServerData

func ServiceToolsetBindSelfServerData() func()

ServiceToolsetBindSelfServerData returns a DSL design function for a method-backed toolset that emits server_data from a bound method result field.

func ServiceToolsetBindSelfServerDataPointerSidecar

func ServiceToolsetBindSelfServerDataPointerSidecar() func()

ServiceToolsetBindSelfServerDataPointerSidecar returns a DSL design function for a method-backed toolset that emits pointer-typed server_data from an optional bound method result field.

The generated codecs must treat nil sidecar values as "no server_data" and therefore encode them to JSON null rather than returning an error.

func TagsBasic

func TagsBasic() func()

TagsBasic returns a DSL design with a tool exposing tags.

func ToolSpecsMinimal

func ToolSpecsMinimal() func()

ToolSpecsMinimal returns a DSL design function for a minimal tool_specs scenario.

func ToolsetNamedTools

func ToolsetNamedTools() func()

ToolsetNamedTools creates a scenario where the toolset is named "tools", which could conflict with the runtime tools package import.

Types

This section is empty.

Jump to

Keyboard shortcuts

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