test(worker): clean up non-git test tmp dir and assert self-heal setup exit code
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -242,11 +242,16 @@ public sealed class PlanningSessionManagerTests : IDisposable
|
||||
var listId = Guid.NewGuid().ToString();
|
||||
var wd = Path.Combine(Path.GetTempPath(), $"cd_nogit_{Guid.NewGuid():N}");
|
||||
Directory.CreateDirectory(wd);
|
||||
await _lists.AddAsync(new ListEntity { Id = listId, Name = "NoGit", WorkingDir = wd, CreatedAt = DateTime.UtcNow });
|
||||
|
||||
var t = await SeedManualTaskAsync(listId);
|
||||
|
||||
await Assert.ThrowsAsync<InvalidOperationException>(() => _sut.StartAsync(t.Id, CancellationToken.None));
|
||||
try
|
||||
{
|
||||
await _lists.AddAsync(new ListEntity { Id = listId, Name = "NoGit", WorkingDir = wd, CreatedAt = DateTime.UtcNow });
|
||||
var t = await SeedManualTaskAsync(listId);
|
||||
await Assert.ThrowsAsync<InvalidOperationException>(() => _sut.StartAsync(t.Id, CancellationToken.None));
|
||||
}
|
||||
finally
|
||||
{
|
||||
try { Directory.Delete(wd, recursive: true); } catch { /* best effort */ }
|
||||
}
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@@ -264,6 +269,7 @@ public sealed class PlanningSessionManagerTests : IDisposable
|
||||
procInfo.ArgumentList.Add(head);
|
||||
var p = System.Diagnostics.Process.Start(procInfo)!;
|
||||
p.WaitForExit();
|
||||
Assert.True(p.ExitCode == 0, $"git branch setup failed with exit {p.ExitCode}");
|
||||
|
||||
var ctx = await _sut.StartAsync(parent.Id, CancellationToken.None);
|
||||
Assert.True(Directory.Exists(ctx.WorktreePath));
|
||||
|
||||
Reference in New Issue
Block a user