runtimeapitest

package
v0.5.0 Latest Latest
Warning

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

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

Documentation

Overview

Package runtimeapitest provides reusable fake runtime backends for dispatcher and Admin contract tests.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Backend

type Backend struct {
	Type string

	CapabilitiesResult runtimeapi.Capabilities
	CapabilitiesError  error
	ServeTurnError     error
	ServeTurnFunc      func(context.Context, agent.Agent, runtimeapi.TurnRequest, runtimeapi.EventSink) error
	// contains filtered or unexported fields
}

Backend implements only runtimeapi.Backend. Tests that need optional capabilities can embed it in a small type implementing the relevant narrow interface, so unsupported capabilities remain truthful.

func NewBackend

func NewBackend(runtimeType string) *Backend

func (*Backend) Capabilities

func (b *Backend) Capabilities(_ context.Context, a agent.Agent) (runtimeapi.Capabilities, error)

func (*Backend) CapabilityCalls

func (b *Backend) CapabilityCalls() []agent.Agent

func (*Backend) RuntimeType

func (b *Backend) RuntimeType() string

func (*Backend) ServeTurn

func (*Backend) SetCapabilities

func (b *Backend) SetCapabilities(result runtimeapi.Capabilities, err error)

SetCapabilities safely replaces the fake result while contract tests are running concurrent calls.

func (*Backend) TurnCalls

func (b *Backend) TurnCalls() []TurnCall

type TurnCall

type TurnCall struct {
	Agent   agent.Agent
	Request runtimeapi.TurnRequest
}

Jump to

Keyboard shortcuts

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