fix: align signed Ticket integration fixtures with native v2
Dependent authorization/backend tests still selected collection/v1 or supplied flat Tool arguments to the native surface introduced by T-797. Use the observed v2 interface, content/observed groups and page cursor/limit coordinates. Do not add a production compatibility fallback. Validation on the final combined tree: cargo test -p worker (1254 lib plus integration targets), -p worker-runtime (562 lib, both 20-test binary targets), and -p yoi-workspace-server (1345 lib passed, 3 existing ignored, 12 binary passed); all normal doctests passed. Signed authorization 29 and Ticket Tool/WIP backend 4 focused cases also passed after fixture repair.
This commit is contained in:
@@ -1997,10 +1997,10 @@ async fn native_wip_ticket_create_uses_same_signed_authorization_before_real_bac
|
|||||||
.as_array()
|
.as_array()
|
||||||
.unwrap()
|
.unwrap()
|
||||||
.iter()
|
.iter()
|
||||||
.find(|interface| interface["reference"]["name"] == "yoi.ticket/collection/v1")
|
.find(|interface| interface["reference"]["name"] == "yoi.ticket/collection/v2")
|
||||||
.expect("native Ticket collection interface")["reference"]
|
.expect("native Ticket collection interface")["reference"]
|
||||||
.clone();
|
.clone();
|
||||||
let args = json!({"path":"/tickets","interface":reference,"operation":"create","arguments":{"title":"Native authorized Ticket"}}).to_string();
|
let args = json!({"path":"/tickets","interface":reference,"operation":"create","arguments":{"content":{"title":"Native authorized Ticket"}}}).to_string();
|
||||||
assert!(
|
assert!(
|
||||||
invoke
|
invoke
|
||||||
.execute(&args, ToolExecutionContext::direct())
|
.execute(&args, ToolExecutionContext::direct())
|
||||||
|
|||||||
@@ -207,6 +207,14 @@ impl TicketSurface {
|
|||||||
)
|
)
|
||||||
.await?;
|
.await?;
|
||||||
if name == "ShowTicket" {
|
if name == "ShowTicket" {
|
||||||
|
let mut page = serde_json::Map::new();
|
||||||
|
for (tool_field, native_field) in [("event_cursor", "cursor"), ("event_limit", "limit")] {
|
||||||
|
if let Some(value) = input.as_object_mut().unwrap().remove(tool_field) {
|
||||||
|
page.insert(native_field.into(), value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
assert!(input.as_object().unwrap().is_empty());
|
||||||
|
input = serde_json::json!({"page": page});
|
||||||
return execute_tool(self.tools["Invoke"].clone(), serde_json::json!({"path":path,"interface":inspected["interfaces"][0]["reference"],"operation":"read","arguments":input}), context).await;
|
return execute_tool(self.tools["Invoke"].clone(), serde_json::json!({"path":path,"interface":inspected["interfaces"][0]["reference"],"operation":"read","arguments":input}), context).await;
|
||||||
}
|
}
|
||||||
execute_tool(self.tools["Invoke"].clone(), serde_json::json!({"path":path,"interface":inspected["interfaces"][0]["reference"],"operation":"read","arguments":{}}), ToolExecutionContext::direct()).await?;
|
execute_tool(self.tools["Invoke"].clone(), serde_json::json!({"path":path,"interface":inspected["interfaces"][0]["reference"],"operation":"read","arguments":{}}), ToolExecutionContext::direct()).await?;
|
||||||
@@ -216,6 +224,16 @@ impl TicketSurface {
|
|||||||
ToolExecutionContext::direct(),
|
ToolExecutionContext::direct(),
|
||||||
)
|
)
|
||||||
.await?;
|
.await?;
|
||||||
|
// The fixture accepts Tool commands for shared scenarios, but invokes the real v2
|
||||||
|
// native coordinates. Do not weaken the production descriptor to accept flat v1 input.
|
||||||
|
if name == "TicketAssignmentAnswer" {
|
||||||
|
let fields = input.as_object_mut().unwrap();
|
||||||
|
let observed = serde_json::json!({
|
||||||
|
"assignment_id": fields.remove("assignment_id").unwrap(),
|
||||||
|
"expected_last_event_id": fields.remove("expected_last_event_id").unwrap(),
|
||||||
|
});
|
||||||
|
fields.insert("observed".into(), observed);
|
||||||
|
}
|
||||||
let operation = match name {
|
let operation = match name {
|
||||||
"TicketAssignmentTrackingQuery" => "assignment_tracking_query",
|
"TicketAssignmentTrackingQuery" => "assignment_tracking_query",
|
||||||
"TicketAssignmentAnswer" => "assignment_answer",
|
"TicketAssignmentAnswer" => "assignment_answer",
|
||||||
|
|||||||
Reference in New Issue
Block a user