Documentation
¶
Overview ¶
Package chattest builds a registered clone with a saved review whose agent session was kept, and a scripted agent, for tests of chats.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Agent ¶
type Agent struct {
generatetest.Backend
Reply func(request agent.Request, n int) (agent.Result, error)
// contains filtered or unexported fields
}
Agent is a scripted Claude Code or Codex: Reply, when set, answers each request (n counts from 0); by default it answers "ok" citing README.md line 1, hands a forked or new session a fresh id and a resumed one its own.
type Fixture ¶
type Fixture struct {
Registry *repos.Registry
Clone repos.Clone
Store *store.Store
Key store.Key
Root string
ReviewDir string
SessionID string
Head string
Agent *Agent
Service *chat.Service
}
Fixture is a registered clone of acme/demo with review version 1 of pull request 7 saved, written by Backend, whose session SessionID was kept in ReviewDir under Root. ReviewDir's head/ holds README.md (one line) and src/app.go (five lines). The clone's pull request head holds README.md too, so a seeded session can cite it.
func (*Fixture) Ask ¶
Ask stores a question as a turn of a new conversation (conversation empty) or of conversation, failing the test on an error.
func (*Fixture) Conversation ¶
Conversation reads a conversation back.
type Options ¶
type Options struct {
// Backend is the review's harness; empty is claude.
Backend string
// NoSession stores the review without a kept session.
NoSession bool
// Hunk gives the review its base and merge base and indexes the pull
// request's config/settings.env hunk, which adds the assembletest
// PlantedSecret, without its diff, as the store keeps it.
Hunk bool
}
Options vary the fixture.