fix: remove stale tests that hang or assert dead behaviour
- Remove tool_merge_agent_work_returns_started and tool_get_merge_status_returns_running: these tested the old non-blocking API but tool_merge_agent_work now blocks in a poll loop, causing the tests to hang forever. - Update coder_agents_have_root_cause_guidance: prompt no longer requires "git bisect" — check for bug workflow guidance instead. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -864,17 +864,12 @@ name = "coder"
|
|||||||
let combined = format!("{prompt} {system_prompt}");
|
let combined = format!("{prompt} {system_prompt}");
|
||||||
|
|
||||||
assert!(
|
assert!(
|
||||||
combined.contains("root cause"),
|
combined.contains("Bug Workflow") || combined.contains("trust the story"),
|
||||||
"Coder agent '{}' must mention 'root cause' in prompt or system_prompt",
|
"Coder agent '{}' must include bug workflow guidance in prompt or system_prompt",
|
||||||
agent.name
|
agent.name
|
||||||
);
|
);
|
||||||
assert!(
|
assert!(
|
||||||
combined.contains("git bisect") || combined.contains("git log"),
|
combined.contains("surgical") || combined.to_lowercase().contains("minimal"),
|
||||||
"Coder agent '{}' must mention 'git bisect' or 'git log' for bug investigation",
|
|
||||||
agent.name
|
|
||||||
);
|
|
||||||
assert!(
|
|
||||||
combined.to_lowercase().contains("do not") || combined.contains("surgical"),
|
|
||||||
"Coder agent '{}' must discourage adding abstractions/workarounds",
|
"Coder agent '{}' must discourage adding abstractions/workarounds",
|
||||||
agent.name
|
agent.name
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -319,22 +319,9 @@ mod tests {
|
|||||||
let _ = result;
|
let _ = result;
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
// tool_merge_agent_work_returns_started removed: the function now blocks
|
||||||
async fn tool_merge_agent_work_returns_started() {
|
// in a poll loop until the merge completes, so it can't be tested without
|
||||||
let tmp = tempfile::tempdir().unwrap();
|
// a full merge pipeline. The blocking behaviour is tested via integration.
|
||||||
setup_git_repo_in(tmp.path());
|
|
||||||
let ctx = test_ctx(tmp.path());
|
|
||||||
|
|
||||||
let result = tool_merge_agent_work(
|
|
||||||
&json!({"story_id": "99_nonexistent", "agent_name": "coder-1"}),
|
|
||||||
&ctx,
|
|
||||||
)
|
|
||||||
.unwrap();
|
|
||||||
let parsed: Value = serde_json::from_str(&result).unwrap();
|
|
||||||
assert_eq!(parsed["story_id"], "99_nonexistent");
|
|
||||||
assert_eq!(parsed["status"], "started");
|
|
||||||
assert!(parsed.get("message").is_some());
|
|
||||||
}
|
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn tool_get_merge_status_no_job() {
|
fn tool_get_merge_status_no_job() {
|
||||||
@@ -345,28 +332,8 @@ mod tests {
|
|||||||
assert!(result.unwrap_err().contains("No merge job"));
|
assert!(result.unwrap_err().contains("No merge job"));
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
// tool_get_merge_status_returns_running removed: depends on
|
||||||
async fn tool_get_merge_status_returns_running() {
|
// tool_merge_agent_work which now blocks indefinitely in a poll loop.
|
||||||
let tmp = tempfile::tempdir().unwrap();
|
|
||||||
setup_git_repo_in(tmp.path());
|
|
||||||
let ctx = test_ctx(tmp.path());
|
|
||||||
|
|
||||||
// Start a merge (it will run in background)
|
|
||||||
tool_merge_agent_work(
|
|
||||||
&json!({"story_id": "99_nonexistent"}),
|
|
||||||
&ctx,
|
|
||||||
)
|
|
||||||
.unwrap();
|
|
||||||
|
|
||||||
// Immediately check — should be running (or already finished if very fast)
|
|
||||||
let result = tool_get_merge_status(&json!({"story_id": "99_nonexistent"}), &ctx).unwrap();
|
|
||||||
let parsed: Value = serde_json::from_str(&result).unwrap();
|
|
||||||
let status = parsed["status"].as_str().unwrap();
|
|
||||||
assert!(
|
|
||||||
status == "running" || status == "completed" || status == "failed",
|
|
||||||
"unexpected status: {status}"
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn report_merge_failure_in_tools_list() {
|
fn report_merge_failure_in_tools_list() {
|
||||||
|
|||||||
Reference in New Issue
Block a user