test(worker): adapt planning tests to git-backed worktree flow

Update constructor calls (6-arg), seed AppSettings with sibling strategy,
git-init working dirs via GitRepoFixture.InitRepoWithInitialCommit, and
replace McpConfigPath assertions with worktree-path / .mcp.json checks.
Also fixes PlanningHubTests which had the same 3-arg constructor.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
mika kuns
2026-04-24 12:14:46 +02:00
parent 9beda55681
commit 0da527dbbc
5 changed files with 58 additions and 17 deletions

View File

@@ -1,6 +1,8 @@
using ClaudeDo.Data;
using ClaudeDo.Data.Git;
using ClaudeDo.Data.Models;
using ClaudeDo.Data.Repositories;
using ClaudeDo.Worker.Config;
using ClaudeDo.Worker.Hub;
using ClaudeDo.Worker.Planning;
using ClaudeDo.Worker.Services;
@@ -28,7 +30,11 @@ public sealed class PlanningHubTests : IDisposable
_tasks = new TaskRepository(_ctx);
_lists = new ListRepository(_ctx);
_rootDir = Path.Combine(Path.GetTempPath(), $"cd_hub_planning_{Guid.NewGuid():N}");
_planning = new PlanningSessionManager(_tasks, _lists, _rootDir);
var git = new GitService();
var cfg = new WorkerConfig { CentralWorktreeRoot = Path.Combine(_rootDir, "central") };
var settingsRepo = new AppSettingsRepository(_ctx);
settingsRepo.UpdateAsync(new AppSettingsEntity { WorktreeStrategy = "sibling" }).GetAwaiter().GetResult();
_planning = new PlanningSessionManager(_tasks, _lists, settingsRepo, git, cfg, _rootDir);
_launcher = new FakePlanningLauncher();
_proxy = new RecordingClientProxy();
}
@@ -54,7 +60,7 @@ public sealed class PlanningHubTests : IDisposable
{
var listId = Guid.NewGuid().ToString();
var wd = Path.Combine(Path.GetTempPath(), $"cd_wd_{Guid.NewGuid():N}");
Directory.CreateDirectory(wd);
GitRepoFixture.InitRepoWithInitialCommit(wd);
await _lists.AddAsync(new ListEntity
{
Id = listId, Name = "L", WorkingDir = wd, CreatedAt = DateTime.UtcNow,