feat: harden community production foundation through story 1.5
This commit is contained in:
@@ -322,6 +322,10 @@ async fn preserves_request_id_for_tool_call_invocations() {
|
||||
response.headers()["x-request-id"].to_str().unwrap(),
|
||||
"req_test_123"
|
||||
);
|
||||
let trace_id = response.headers()["x-trace-id"]
|
||||
.to_str()
|
||||
.unwrap()
|
||||
.to_owned();
|
||||
let call_result = response.json::<Value>().await.unwrap();
|
||||
assert_eq!(call_result["result"]["isError"], false);
|
||||
|
||||
@@ -341,6 +345,7 @@ async fn preserves_request_id_for_tool_call_invocations() {
|
||||
|
||||
assert_eq!(logs.len(), 1);
|
||||
assert_eq!(logs[0].log.request_id.as_deref(), Some("req_test_123"));
|
||||
assert_eq!(logs[0].log.trace_id.as_deref(), Some(trace_id.as_str()));
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
@@ -408,6 +413,13 @@ async fn generates_request_id_for_tool_call_responses_and_logs() {
|
||||
.to_str()
|
||||
.unwrap()
|
||||
.to_owned();
|
||||
let trace_id = response
|
||||
.headers()
|
||||
.get("x-trace-id")
|
||||
.unwrap()
|
||||
.to_str()
|
||||
.unwrap()
|
||||
.to_owned();
|
||||
assert_eq!(
|
||||
uuid::Uuid::parse_str(&request_id).unwrap().get_version(),
|
||||
Some(Version::SortRand)
|
||||
@@ -432,6 +444,7 @@ async fn generates_request_id_for_tool_call_responses_and_logs() {
|
||||
|
||||
assert_eq!(logs.len(), 1);
|
||||
assert_eq!(logs[0].log.request_id.as_deref(), Some(request_id.as_str()));
|
||||
assert_eq!(logs[0].log.trace_id.as_deref(), Some(trace_id.as_str()));
|
||||
}
|
||||
|
||||
#[tokio::test(flavor = "current_thread")]
|
||||
|
||||
Reference in New Issue
Block a user