Documentation
¶
Overview ¶
Package testutil provides test utilities for subtask e2e tests.
Index ¶
- func AssertGolden(t *testing.T, relPath string, got string)
- func AssertGoldenOutput(t *testing.T, relBasePath string, got string)
- func IsClean(t *testing.T, dir string) bool
- type TestEnv
- func (e *TestEnv) Config() *workspace.Config
- func (e *TestEnv) CreateTask(name, title, base, description string) *task.Task
- func (e *TestEnv) CreateTaskHistory(name string, events []history.Event)
- func (e *TestEnv) CreateTaskProgress(name string, progress *task.Progress)
- func (e *TestEnv) CreateTaskState(name string, state *task.State)
- func (e *TestEnv) MakeDirty(workspaceIdx int)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AssertGolden ¶
AssertGolden compares got to the contents of relPath. If -update (or SUBTASK_UPDATE_GOLDEN) is set, it rewrites the golden file.
relPath is resolved relative to the calling test file's directory (so it works even if the test changes the process cwd).
func AssertGoldenOutput ¶
AssertGoldenOutput compares got to a golden file based on the current output mode. In pretty mode it uses a `.ansi` file, otherwise it uses a `.txt` file.
relBasePath is resolved relative to the calling test file's directory.
Types ¶
type TestEnv ¶
type TestEnv struct {
T *testing.T
RootDir string // Temp directory simulating project root
Workspaces []string // Paths to workspace directories
// contains filtered or unexported fields
}
TestEnv encapsulates an isolated test environment.
func NewTestEnv ¶
NewTestEnv creates an isolated test environment with git repos.
func (*TestEnv) CreateTask ¶
CreateTask creates a task with TASK.md.
func (*TestEnv) CreateTaskHistory ¶
CreateTaskHistory creates (or replaces) history.jsonl for a task.
func (*TestEnv) CreateTaskProgress ¶
CreateTaskProgress creates a progress.json for a task.
func (*TestEnv) CreateTaskState ¶
CreateTaskState creates a state.json for a task.