Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GitCommitAll ¶
GitCommitAll stages and commits all files.
func InitGitRepo ¶
InitGitRepo initializes a git repo with an initial commit.
Types ¶
type Scenario ¶
type Scenario struct {
Name string
Script []testutil.ScriptEntry
// Setup is called before the scenario runs. It receives the workspace
// root and should create any files/repos needed. Returns the prompt.
Setup func(t *testing.T, root string) string
// ExtraTools adds additional tools beyond the standard local tool set.
ExtraTools []agent.AgentTool
// SystemPrompt overrides the default system prompt.
SystemPrompt string
// OnRunning is called after the agent starts but before waiting for
// completion. Use for injecting steering or follow-ups mid-run.
OnRunning func(t *testing.T, a *agent.Agent)
// ProviderGates blocks specific provider calls (0-indexed) until closed.
// Use to synchronize mid-turn actions like steering/follow-ups.
ProviderGates map[int]chan struct{}
// Timeout for the entire scenario. Defaults to 10s.
Timeout time.Duration
// Assert is called after the scenario completes to verify outcomes.
Assert func(t *testing.T, result *ScenarioResult)
}
Scenario defines a complete E2E test scenario.
type ScenarioResult ¶
type ScenarioResult struct {
// Events is the ordered sequence of all agent events.
Events []agent.AgentEvent
// Session is the final agent session state.
Session *agent.Session
// WorkspaceRoot is the path to the workspace directory.
WorkspaceRoot string
// ProviderCalls is the number of calls made to the provider.
ProviderCalls int
ProviderLog []testutil.ScriptedProviderCall
// Error is set if the scenario failed to start or errored.
Error error
}
ScenarioResult captures all observable outcomes from a scenario run.
func Run ¶
func Run(t *testing.T, scenario Scenario) *ScenarioResult
Run executes a single scenario and returns the result.
func (*ScenarioResult) ConversationUserMessages ¶
func (r *ScenarioResult) ConversationUserMessages() []string
ConversationUserMessages returns all user message texts from the session.
func (*ScenarioResult) EventsOfType ¶
func (r *ScenarioResult) EventsOfType(typ agent.AgentEventType) []agent.AgentEvent
EventsOfType returns all events matching the given type.
func (*ScenarioResult) HasEventSequence ¶
func (r *ScenarioResult) HasEventSequence(types ...agent.AgentEventType) bool
HasEventSequence checks that the given event types appear in order (not necessarily contiguously) in the event stream.
func (*ScenarioResult) ToolCallNames ¶
func (r *ScenarioResult) ToolCallNames() []string
ToolCallNames returns an ordered list of tool names that were started.
Click to show internal directories.
Click to hide internal directories.