huskies: merge 813
This commit is contained in:
@@ -910,6 +910,41 @@ mod tests {
|
||||
);
|
||||
}
|
||||
|
||||
/// A story in 4_merge with blocked: true must NOT auto-spawn mergemaster
|
||||
/// even when it has an unresolved content-conflict merge_failure and
|
||||
/// mergemaster_attempted is still false.
|
||||
#[tokio::test]
|
||||
async fn auto_assign_does_not_spawn_mergemaster_for_blocked_story() {
|
||||
let tmp = tempfile::tempdir().unwrap();
|
||||
let sk = tmp.path().join(".huskies");
|
||||
std::fs::create_dir_all(&sk).unwrap();
|
||||
std::fs::write(
|
||||
sk.join("project.toml"),
|
||||
"[[agent]]\nname = \"mergemaster\"\nstage = \"mergemaster\"\n",
|
||||
)
|
||||
.unwrap();
|
||||
crate::db::ensure_content_store();
|
||||
crate::db::write_item_with_content(
|
||||
"9863_story_blocked_conflict",
|
||||
"4_merge",
|
||||
"---\nname: Blocked conflict\nmerge_failure: \"CONFLICT (content): foo.rs\"\nblocked: true\n---\n",
|
||||
);
|
||||
|
||||
let pool = AgentPool::new_test(3001);
|
||||
pool.auto_assign_available_work(tmp.path()).await;
|
||||
|
||||
let agents = pool.agents.lock().unwrap();
|
||||
let mergemaster_spawned = agents.iter().any(|(key, a)| {
|
||||
key.contains("9863_story_blocked_conflict")
|
||||
&& a.agent_name == "mergemaster"
|
||||
&& matches!(a.status, AgentStatus::Pending | AgentStatus::Running)
|
||||
});
|
||||
assert!(
|
||||
!mergemaster_spawned,
|
||||
"mergemaster must not be spawned for a blocked story"
|
||||
);
|
||||
}
|
||||
|
||||
/// A story with mergemaster_attempted: true must NOT auto-spawn again, even
|
||||
/// if the merge_failure still contains a content conflict.
|
||||
#[tokio::test]
|
||||
|
||||
Reference in New Issue
Block a user