test(worker): consolidate fakes into Infrastructure/, drop tag-era names

- Extract FakeClaudeProcess to Infrastructure/FakeClaudeProcess.cs (was
  defined inline in QueueServiceTests #region); all consumers updated
- Replace duplicate FakeHubContext/FakeHubClients/FakeClientProxy
  (QueueServiceTests) with existing CapturingHubContext from Infrastructure
  across all 7 affected files; Planning's file-local FakeHubContext kept
- Rename SeedListWithAgentTag → SeedListAsync (return Task<string>, drop
  unused agentTagId tuple element) and SeedListWithAgentTagAsync → SeedListAsync
- PrimeRunnerTests keeps its private nested FakeClaudeProcess: constructor
  API (delay/exitCode/lines/result params) differs from the shared one and
  replacement would require rewriting every test in that file

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
mika kuns
2026-06-09 23:04:59 +02:00
parent ddeded988a
commit d4af345ac3
9 changed files with 50 additions and 84 deletions

View File

@@ -7,7 +7,6 @@ using ClaudeDo.Worker.Lifecycle;
using ClaudeDo.Worker.Queue;
using ClaudeDo.Worker.Runner;
using ClaudeDo.Worker.Tests.Infrastructure;
using ClaudeDo.Worker.Tests.Services;
using ClaudeDo.Worker.Worktrees;
using ClaudeDo.Worker.Config;
using Microsoft.Extensions.Logging.Abstractions;
@@ -62,7 +61,7 @@ public sealed class AddSubtaskToolTests : IDisposable
QueueBackstopIntervalMs = 50,
};
var dbFactory = _db.CreateFactory();
var hubCtx = new FakeHubContext();
var hubCtx = new CapturingHubContext();
var broadcaster = new HubBroadcaster(hubCtx);
var git = new ClaudeDo.Data.Git.GitService();
var wtManager = new WorktreeManager(git, dbFactory, cfg, NullLogger<WorktreeManager>.Instance);