MCPcopy Create free account
hub / github.com/compozy/agh / registerTaskManagerWorkspace

Function registerTaskManagerWorkspace

internal/task/manager_integration_test.go:2326–2344  ·  view source on GitHub ↗
(t *testing.T, db *globaldb.GlobalDB, name string, rootDir string)

Source from the content-addressed store, hash-verified

2324}
2325
2326func registerTaskManagerWorkspace(t *testing.T, db *globaldb.GlobalDB, name string, rootDir string) string {
2327 t.Helper()
2328
2329 if err := os.MkdirAll(rootDir, 0o755); err != nil {
2330 t.Fatalf("MkdirAll(%q) error = %v", rootDir, err)
2331 }
2332
2333 workspace := aghworkspace.Workspace{
2334 ID: "ws-" + strings.ReplaceAll(name, " ", "-"),
2335 RootDir: rootDir,
2336 Name: name,
2337 CreatedAt: time.Date(2026, 4, 14, 10, 0, 0, 0, time.UTC),
2338 UpdatedAt: time.Date(2026, 4, 14, 10, 0, 0, 0, time.UTC),
2339 }
2340 if err := db.InsertWorkspace(testutil.Context(t), workspace); err != nil {
2341 t.Fatalf("InsertWorkspace() error = %v", err)
2342 }
2343 return workspace.ID
2344}
2345
2346func intPtr(value int) *int {
2347 return &value

Calls 2

ContextFunction · 0.92
InsertWorkspaceMethod · 0.65

Tested by

no test coverage detected