forked from github/copilot-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinprocess.rs
More file actions
31 lines (27 loc) · 1.31 KB
/
Copy pathinprocess.rs
File metadata and controls
31 lines (27 loc) · 1.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
use super::support::with_e2e_context;
/// Starts an in-process client, performs a round-trip, and stops cleanly.
/// Fails hard if the in-process runtime library cannot be loaded.
#[tokio::test]
async fn should_start_ping_and_stop_inprocess_client() {
with_e2e_context("client", "should_start_ping_and_stop_stdio_client", |ctx| {
Box::pin(async move {
let client = ctx.start_inprocess_client().await;
let timings = client.startup_timings().expect("startup timings");
assert!(timings.program_resolve_ms.is_some());
assert!(timings.process_spawn_ms.is_none());
assert!(timings.port_wait_ms.is_none());
assert!(timings.total_ms >= timings.transport_setup_ms);
assert!(timings.total_ms >= timings.handshake_ms);
let response = client
.ping(Some("hello from rust in-process"))
.await
.expect("ping over in-process FFI transport");
assert_eq!(response.message, "pong: hello from rust in-process");
assert!(!response.timestamp.is_empty());
let status = client.get_status().await.expect("get status");
assert!(status.protocol_version > 0);
client.stop().await.expect("stop in-process client");
})
})
.await;
}