Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InitGitRepoWithOrigin ¶ added in v0.0.10
InitGitRepoWithOrigin git-inits dir, makes an initial (empty) commit, and adds an origin remote so it satisfies `project add`'s upstream_url capture requirement (see docs/plans/git-gateway-cutover.md PR2: a project with no git origin remote is now rejected at registration time). The origin URL is a fixed placeholder — tests exercising this helper only need `project add` / `project reload` to see *some* origin, never a real fetchable remote.
The initial commit exists so `git rev-parse --abbrev-ref HEAD` (used by orchestrator.ExpandBaseBranch's ${current_branch} expansion) resolves: a freshly `git init`'d repo with zero commits has an unborn HEAD, which rev-parse rejects with exit 128 ("ambiguous argument 'HEAD'"). That was invisible for non-canonical task behaviors before the git gateway cutover closed the gap where they could keep an empty base_branch — see internal/api/task_create.go's CreateTask comment. -c user.name/user.email are passed explicitly rather than relying on ambient git config, which a bare CI runner may not have.
func SeedWorkspace ¶ added in v0.0.13
func SeedWorkspace(t *testing.T, ts *TestServer, slug string)
SeedWorkspace upserts an empty workspaces table row for slug directly via the daemon's DB, bypassing both the CLI (cmd/workspace.go's shadow-yaml path, out of scope until PR4 of docs/plans/workspace-db-consolidation.md) and the HTTP API (which as of PR3 only exposes GET /api/workspaces, no creation endpoint). Tests that assign a project to a workspace slug other than orchestrator.DefaultWorkspaceSlug must call this first: MAJOR 5 (codex review) makes ProjectAppService.SetProjectWorkspace reject assignment to a slug with no corresponding row.
Types ¶
type MockSandbox ¶
type MockSandbox struct {
SetupCalled bool
Config sandbox.SandboxConfig
ShellCalls []string
CleanedUp bool
}
func (*MockSandbox) Cleanup ¶
func (m *MockSandbox) Cleanup() error
func (*MockSandbox) Setup ¶
func (m *MockSandbox) Setup(cfg sandbox.SandboxConfig) error
type TestServer ¶
TestServer wraps a running server for testing.
func NewTestServer ¶
func NewTestServer(t *testing.T) *TestServer
NewTestServer starts a server with a temp UNIX socket and in-memory DB.