use pretty_assertions::assert_eq;
use super::STARLARK_VERSION;
#[test]
fn frozen_planner_version_matches_starlark_dependency() {
let manifest: toml::Value = toml::from_str(include_str!("../../../Cargo.toml")).unwrap();
let dependency = manifest
.get("dependencies")
.and_then(|dependencies| dependencies.get("starlark"))
.and_then(toml::Value::as_str);
let expected = format!("={STARLARK_VERSION}");
assert_eq!(dependency, Some(expected.as_str()));
}
#[test]
fn recheck_refuses_a_retired_runtime_before_its_executable() {
use crate::workflow::{
test_support::{agent_node, workflow},
AgentRuntime, ResolvedNode, WorkspaceAccess,
};
let mut graph = workflow(vec![agent_node("review", &[], WorkspaceAccess::ReadOnly)]);
for resolved in graph.resolved_nodes.values_mut() {
if let ResolvedNode::Agent(agent) = resolved {
agent.runtime = AgentRuntime::RetiredCursor;
agent.executable = Some("/gone/cursor-agent".to_owned());
agent.executable_identity = None;
}
}
let error = super::recheck_frozen_graph(
&graph,
None,
None,
crate::workspace::ProjectTrusts::UNTRUSTED,
)
.unwrap_err();
assert_eq!(
error.to_string(),
"frozen agent 'reviewer' was planned for the retired cursor runtime; plan the workflow again"
);
}