(t *testing.T)
| 5374 | } |
| 5375 | |
| 5376 | func TestManagerStickyTaskBlockNeverAutoClears(t *testing.T) { |
| 5377 | t.Parallel() |
| 5378 | |
| 5379 | store := newInMemoryManagerStore() |
| 5380 | manager := newTaskManagerForTest(t, store) |
| 5381 | actor := validActorContext() |
| 5382 | taskRecord, err := manager.CreateTask(context.Background(), CreateTask{ |
| 5383 | Scope: ScopeWorkspace, |
| 5384 | WorkspaceID: "ws-sticky-block", |
| 5385 | Title: "Sticky block", |
| 5386 | }, actor) |
| 5387 | if err != nil { |
| 5388 | t.Fatalf("CreateTask() error = %v", err) |
| 5389 | } |
| 5390 | |
| 5391 | block, err := manager.BlockTask(context.Background(), BlockRequest{ |
| 5392 | TaskID: taskRecord.ID, |
| 5393 | Kind: BlockKindNeedsInput, |
| 5394 | Reason: "waiting for creator", |
| 5395 | }, actor) |
| 5396 | if err != nil { |
| 5397 | t.Fatalf("BlockTask() error = %v", err) |
| 5398 | } |
| 5399 | reconciled, err := manager.reconcileTaskCascade(context.Background(), taskRecord.ID) |
| 5400 | if err != nil { |
| 5401 | t.Fatalf("reconcileTaskCascade() error = %v", err) |
| 5402 | } |
| 5403 | if got, want := reconciled.Status, TaskStatusBlocked; got != want { |
| 5404 | t.Fatalf("reconciled.Status = %q, want %q", got, want) |
| 5405 | } |
| 5406 | openBlocks, err := manager.ListTaskBlocks(context.Background(), taskRecord.ID, false, actor) |
| 5407 | if err != nil { |
| 5408 | t.Fatalf("ListTaskBlocks() error = %v", err) |
| 5409 | } |
| 5410 | if len(openBlocks) != 1 || openBlocks[0].ID != block.ID || !openBlocks[0].ClearedAt.IsZero() { |
| 5411 | t.Fatalf("openBlocks = %#v, want sticky block %q still open", openBlocks, block.ID) |
| 5412 | } |
| 5413 | } |
| 5414 | |
| 5415 | func TestTaskStatusFromPolicySnapshotPrecedence(t *testing.T) { |
| 5416 | t.Parallel() |
nothing calls this directly
no test coverage detected