补充工具动作终态断言的失败诊断
Project CI / AI game creator shell Rust shard 1/4 (pull_request) Has been cancelled
Project CI / AI game creator shell Rust shard 2/4 (pull_request) Has been cancelled
Project CI / AI game creator shell Rust shard 3/4 (pull_request) Has been cancelled
Project CI / AI game creator shell Rust shard 4/4 (pull_request) Has been cancelled
Project CI / AI game creator shell Rust smoke (pull_request) Has been cancelled
Project CI / AI game creator shell Rust crates (pull_request) Has been cancelled
Project CI / Backend tests (pull_request) Has been cancelled
Project CI / Native shell tests (pull_request) Has been cancelled
Project CI / Frontend tests (pull_request) Has been cancelled
Project CI / Repository checks (pull_request) Has been cancelled
Project CI / AI game creator shell web tests (pull_request) Has been cancelled
Project CI / AI game creator shell Rust shard 1/4 (pull_request) Has been cancelled
Project CI / AI game creator shell Rust shard 2/4 (pull_request) Has been cancelled
Project CI / AI game creator shell Rust shard 3/4 (pull_request) Has been cancelled
Project CI / AI game creator shell Rust shard 4/4 (pull_request) Has been cancelled
Project CI / AI game creator shell Rust smoke (pull_request) Has been cancelled
Project CI / AI game creator shell Rust crates (pull_request) Has been cancelled
Project CI / Backend tests (pull_request) Has been cancelled
Project CI / Native shell tests (pull_request) Has been cancelled
Project CI / Frontend tests (pull_request) Has been cancelled
Project CI / Repository checks (pull_request) Has been cancelled
Project CI / AI game creator shell web tests (pull_request) Has been cancelled
- tests/mod.rs 新增 assert_observation_status,断言失败时输出 tool/status/summary/detail - command_runtime.rs 中 6 处 observation.status 断言改用该 helper,替换只输出 left/right 的裸 assert_eq - 目的:CI 上命令类用例失败时能直接看到真实 observation,而不是仅剩状态值差异
This commit is contained in:
@@ -1062,7 +1062,7 @@ async fn command_exec_output_sidecar_failure_runs_once_and_requires_reconciliati
|
||||
)
|
||||
.await;
|
||||
|
||||
assert_eq!(observation.status, "needs-reconciliation");
|
||||
assert_observation_status(&observation, "needs-reconciliation");
|
||||
assert!(observation
|
||||
.detail
|
||||
.as_deref()
|
||||
@@ -1529,7 +1529,7 @@ async fn agent_runtime_command_exec_revalidates_revision_after_acquiring_project
|
||||
)
|
||||
.await;
|
||||
|
||||
assert_eq!(observation.status, "verification-failed");
|
||||
assert_observation_status(&observation, "verification-failed");
|
||||
assert!(observation
|
||||
.detail
|
||||
.as_deref()
|
||||
@@ -1588,7 +1588,7 @@ async fn agent_runtime_command_exec_requires_reconciliation_after_audit_failure(
|
||||
)
|
||||
.await;
|
||||
|
||||
assert_eq!(observation.status, "needs-reconciliation");
|
||||
assert_observation_status(&observation, "needs-reconciliation");
|
||||
assert!(observation.summary.contains("执行结果不完整"));
|
||||
assert!(observation
|
||||
.detail
|
||||
@@ -1897,7 +1897,7 @@ async fn agent_runtime_command_exec_agent_db_audit_failure_keeps_gate_failed() {
|
||||
)
|
||||
.await;
|
||||
|
||||
assert_eq!(observation.status, "needs-reconciliation");
|
||||
assert_observation_status(&observation, "needs-reconciliation");
|
||||
assert!(observation.summary.contains("执行审计无法完整落盘"));
|
||||
let gate = read_game_creator_agent_runtime_verification_gate(&root, "code-prototype", run_id)
|
||||
.expect("read failed audit gate");
|
||||
@@ -1981,7 +1981,7 @@ async fn agent_runtime_command_exec_rejects_changed_pending_action_identity_afte
|
||||
Some(&pending),
|
||||
)
|
||||
.await;
|
||||
assert_eq!(wrong_id_observation.status, "verification-failed");
|
||||
assert_observation_status(&wrong_id_observation, "verification-failed");
|
||||
assert!(wrong_id_observation
|
||||
.detail
|
||||
.as_deref()
|
||||
@@ -1998,7 +1998,7 @@ async fn agent_runtime_command_exec_rejects_changed_pending_action_identity_afte
|
||||
)
|
||||
.await;
|
||||
|
||||
assert_eq!(observation.status, "verification-failed");
|
||||
assert_observation_status(&observation, "verification-failed");
|
||||
assert!(observation
|
||||
.detail
|
||||
.as_deref()
|
||||
|
||||
@@ -501,6 +501,15 @@ fn wait_for_agent_runtime_lane_release(
|
||||
}
|
||||
}
|
||||
|
||||
/// 断言工具动作 observation 的终态:失败时打印全部字段,避免 CI 只留下 `left == right`。
|
||||
fn assert_observation_status(observation: &AgentRuntimeToolObservation, expected: &str) {
|
||||
assert_eq!(
|
||||
observation.status, expected,
|
||||
"observation status mismatch: tool={} status={} summary={} detail={:?}",
|
||||
observation.tool, observation.status, observation.summary, observation.detail
|
||||
);
|
||||
}
|
||||
|
||||
fn wait_for_agent_runtime_idle(root: &Path, agent_id: &str) -> AgentRuntimeState {
|
||||
wait_for_agent_runtime_lane_release(root, agent_id, "wait_for_agent_runtime_idle")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user