Documentation
¶
Overview ¶
Package agenttest provides agent environments, platform mocks, and caller contexts for tests of agents built on agentsdk.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WithCaller ¶
WithCaller returns a context for an authenticated user with the given access. Identity does not determine access, so tests can model any valid combination.
Types ¶
type Env ¶
type Env struct {
Agent *agentsdk.Agent
// Airlock records calls made through the platform API.
Airlock *MockAirlock
// URL is the mock Airlock base URL.
URL string
}
Env is a fully constructed test agent with its mock Airlock server.
func New ¶
New configures a mock Airlock and test database before invoking factory. TEST_DB_URL is used when explicitly supplied; otherwise New starts a throwaway pgvector container. agentsdk.New finds db/migrations from the enclosing Go module, then resets and applies them before it returns to the rest of factory, so dependency construction and registrations always see a clean, migrated schema.
type MockAirlock ¶
type MockAirlock = mockairlock.Mock
MockAirlock is an in-process Airlock API used by agent tests.
func NewMockAirlock ¶
func NewMockAirlock() (*MockAirlock, string)
NewMockAirlock creates a mock Airlock server and returns its base URL.
type MockRequest ¶
type MockRequest = mockairlock.Request
MockRequest records a request made to the mock Airlock server.